I have a pop up calendar attached to my data entry form. I would like to standadised my date entry to every Sunday. How can I modify the calendar so that only Sunday can be selected?
You could use the VeforeUpdate event to modify the value of the calendar to the first day of week (which you set to Sunday. Trial code (ActiveXCtl6 is the Calendar object):
Code:
Private Sub ActiveXCtl6_BeforeUpdate(Cancel As Integer)
Dim v
Dim wk As Integer
With ActiveXCtl6
v = .Value
wk = WeekDay(v, vbSunday)
v = v - wk + 1
.Value = v
End With
End Sub
Thanks for the tip, but I am not sure how to incorporate this code into the following code I used to transfer the date chosen in the calendar to the date field (which is WeekEnding). I tried to put if after the 2nd line but didn't work.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.