ClaraBarton
Registered User.
- Local time
- Yesterday, 23:12
- Joined
- Oct 14, 2019
- Messages
- 578
Is there a way I can combine these 2 ?
Code:
Public Sub UpdatePrepNote()
Dim frm As Form
Dim sql As String
Dim cPrepNote As String
Dim rs As DAO.Recordset
Set frm = Me!frmCalendarWeek.Form
sql = "SELECT MenuDate, PrepNote, Weekday " & _
"FROM qryAppointments where " & _
"MenuDate Between (#" & Me.txtDate & "#) AND (#" & (Me.txtDate + 6) & "#)" & _
"ORDER BY Weekday"
Set rs = CurrentDb.OpenRecordset(sql)
With rs
Do While Not .EOF
cPrepNote = cPrepNote & vbCrLf & .Fields(1)
.MoveNext
Loop
.Close
End With
Do While Not rs.EOF
Select Case Weekday(rs!menudate)
Case vbSunday
frm.NoteSun = rs!PrepNote
Case vbMonday
frm.NoteMon = rs!PrepNote
Case vbTuesday
frm.NoteTues = rs!PrepNote
Case vbWednesday
frm.NoteWed = rs!PrepNote
Case vbThursday
frm.NoteThurs = rs!PrepNote
Case vbFriday
frm.NoteFri = rs!PrepNote
Case vbSaturday
frm.NoteSat = rs!PrepNote & vbCrLf & rs!PrepNote
End Select
rs.MoveNext
Loop
End Sub