Hi All,
This may sound a little silly, but I would like to make a control that returns the Monday date of the week that the user is selecting. In other words, no matter what day they pick in that week, I would like the returned value to be for the Monday of that week. No idea where to start on this one....
Thanks,
Mark
Date Picker - Set certain date based on week selected
-
- 3StarLounger
- Posts: 253
- Joined: 19 Apr 2010, 09:01
- Location: Indiana, USA
-
- Administrator
- Posts: 78540
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Date Picker - Set certain date based on week selected
Create a text box. Name it txtDate and set its Format property to a date format. When the user activates the text box (by tabbing or clicking), Access will automatically display a calendar icon.
Create an After Update event procedure for the text box:
Create an After Update event procedure for the text box:
Code: Select all
Private Sub txtDate_AfterUpdate()
If Not IsNull(Me.txtDate) Then
Me.txtDate = Me.txtDate - Weekday(Me.txtDate) + 2
End If
End Sub
Best wishes,
Hans
Hans
-
- 3StarLounger
- Posts: 253
- Joined: 19 Apr 2010, 09:01
- Location: Indiana, USA
Re: Date Picker - Set certain date based on week selected
Hi Hans,
Works great!
Thanks,
Mark
Works great!
Thanks,
Mark
Thanks,
Mark
Mark