Full Version: validating that a date is filled in.
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
warehouseman
I'm still learning - so for me this is not a goofy question. I have a form that requires a date to be filled in. Initially the control is blank. I do not want them to be able to close the form without a date being entered (unless they click the 'exit without saving' command that I have working just fine). I've experimented (and read) on how to validate that the date has been entered but have not come up with the solution where it works.
freakazeud
Hi,
use the before update event of the control or form e.g.:

If Not IsDate(Me.YourControl) Then
Cancel = True
msgbox("please provide a valid date!")
End If

HTH
Good luck
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.