I have a textbox that i use as a calendar option. The text box populates the calendar option on the right. When clicked a Calendar picker type option appears. I'd like to be able to limit to only allow the user to pick current day to days before. Hope this makes sense.
Textbox Calendar Limiting
Collapse
X
-
Tags: None
-
You can't limit the datepicker to prevent a user from CHOOSING a date in the future, but you CAN prevent the user from SAVING it.
In the CONTROLS Before_Update event you can do:
Code:Private Sub DateControl_BeforeUpdate(Cancel as Integer) If Isnull(me.DateControl) then exit sub 'This allows the user to blank out the control if Me.DateControl>Date() then Cancel=True 'This stops the user from saving msgbox "The date entered lies in the future, please correct" End If End Sub
-
Comment