Hi everyone,
This is just something that was puzzling me as to why I couldn't find a simple function, in Access 97, to state the day in a text box [Daybox] on a form.
This line, inserted before 'Me.Requery' in a Private Sub does the trick, if a little long windedly;
If WeekDay(DATECHOOSER, vbMonday) = 1 Then Daybox.Value = "Monday" Else If WeekDay(DATECHOOSER, vbMonday) = 2 Then Daybox.Value = "Tuesday" Else If WeekDay(DATECHOOSER, vbMonday) = 3 Then Daybox.Value = "Wednesday" Else If WeekDay(DATECHOOSER, vbMonday) = 4 Then Daybox.Value = "Thursday" Else If WeekDay(DATECHOOSER, vbMonday) = 5 Then Daybox.Value = "Friday"
' Continue the sequence if Weekend days are required
note: [DATECHOOSER] is another textbox which shows the source date.
If anyone knows of a simpler way of doing this, please post it as a Helpful Tip. I'm sure others would appreciate this trivial piece of functionality.
Cheers,
Rémy
This is just something that was puzzling me as to why I couldn't find a simple function, in Access 97, to state the day in a text box [Daybox] on a form.
This line, inserted before 'Me.Requery' in a Private Sub does the trick, if a little long windedly;
If WeekDay(DATECHOOSER, vbMonday) = 1 Then Daybox.Value = "Monday" Else If WeekDay(DATECHOOSER, vbMonday) = 2 Then Daybox.Value = "Tuesday" Else If WeekDay(DATECHOOSER, vbMonday) = 3 Then Daybox.Value = "Wednesday" Else If WeekDay(DATECHOOSER, vbMonday) = 4 Then Daybox.Value = "Thursday" Else If WeekDay(DATECHOOSER, vbMonday) = 5 Then Daybox.Value = "Friday"
' Continue the sequence if Weekend days are required
note: [DATECHOOSER] is another textbox which shows the source date.
If anyone knows of a simpler way of doing this, please post it as a Helpful Tip. I'm sure others would appreciate this trivial piece of functionality.
Cheers,
Rémy