ClaraBarton
Registered User.
- Local time
- Yesterday, 23:11
- Joined
- Oct 14, 2019
- Messages
- 578
I'm completely at a loss here... I want a different note for each date of the week and this is where I am so far:
How do I say put the PrepNote in the matching field by date?
Code:
Public Sub UpdatePrepNote()
Dim sql As String
Dim vDate(6) As String
Dim vPrepNote(6) As Field
Dim rst As DAO.Recordset
Dim frm As Form
Set frm = Me!frmCalendarWeek.Form
vPrepNote(0) = frm!NoteSun
vPrepNote(1) = frm!NoteMon
vPrepNote(2) = frm!NoteTues
vPrepNote(3) = frm!NoteWed
vPrepNote(4) = frm!NoteThurs
vPrepNote(5) = frm!NoteFri
vPrepNote(6) = frm!NoteSat
vDate(0) = Me.txtDate
vDate(1) = Me.txtDate + 1
vDate(2) = Me.txtDate + 2
vDate(3) = Me.txtDate + 3
vDate(4) = Me.txtDate + 4
vDate(5) = Me.txtDate + 5
vDate(6) = Me.txtDate + 6
sql = "SELECT MenuDate, PrepNote " & _
"FROM qryAppointments " & _
"MenuDate Between (#" & Me.txtDate & "#) AND (#" & (Me.txtDate + 6) & "#)" & _
"ORDER BY MenuDate"
Set rst = CurrentDb.OpenRecordset(sql)
For Each Field In vPrepNote
rst!