Restricting the Date

George Hewitt

Registered User.
Local time
Today, 09:23
Joined
Nov 11, 2013
Messages
23
Hello all. So i have another question I have had on my mind recently regarding Date.

I want to limit the choice of dates entered so it only allows certain dates. E.G. Can only a date which resides on a sunday.

If anyone has any general guidance on how to achieve this or manipulate formatting on Date it would be useful. Is there a way in doing this in the date picker/calender thing or will it be alot more technical and involve VBA coding.

Cheers

George
 
Try the BeforeUpdate event of the Date Control.
 
No way to do it in the Calander thing that I know off.

You can fill a combobox with the required dates quite easily with some VBA or fill a table with the allowable dates.
 
I reckon you could use the before update function on the field in question to test which date had been selected. It would involve some VBA coding, for sure - depends on your requirements as to how complex that would be. You could, for example, cause the date to "snap to" the nearest Sunday, if that is what you wanted, with a helpful message to the end user.
 
I like AJ's idea of snapping it to the nearest/next...
 
Thank you, David R.
George, would you like some sample code, or are you all sorted?
 

Users who are viewing this thread

Back
Top Bottom