Hi,
I've got a form element (txtStartDate) that is linked to a Date field in a table. I've created another element in the form (txtStartDay), a text box, that displays a week day of the corresponding date.
This however does not work as intended. The displayed weekday does not correspond with the date for some reason. Also, the updates do not register if I change the date via a date picker. I usually have to click away and come back to the date picker or something somilar to see any change in the displayed txtStartDay.
I've got a form element (txtStartDate) that is linked to a Date field in a table. I've created another element in the form (txtStartDay), a text box, that displays a week day of the corresponding date.
This however does not work as intended. The displayed weekday does not correspond with the date for some reason. Also, the updates do not register if I change the date via a date picker. I usually have to click away and come back to the date picker or something somilar to see any change in the displayed txtStartDay.
Code:
Private Sub txtStartDate_Change()
Dim DName As String
Dim DIndex As Integer
DIndex = Weekday(Me.txtStartDate)
DName = WeekdayName(DIndex)
Me.txtStartDay.Value = DName
End Sub