By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,705 Members | 1,845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,705 IT Pros & Developers. It's quick & easy.

Validation Rule for Date (1/1/yyyy or 12/1/yyyy)

P: n/a
Rob
How can I create a validation rule for only allowing
two specific dates but with variable years:

1/1/yyyy or 12/1/yyyy

so only the dates 1/1/2004 or 1/1/1999
or 12/1/2001 etc.
I tried the yyyy but it won't let me do it

You can put it in the Mask property but only one date?

Thanks

Rob

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
If you're using a form for data entry, then
use the Before Update event (air code):

If Format(Me.YourDate,'mmdd')<>'0101' And _
Format(Me.YourDate,'mmdd')<>'1201' Then
Msgbox 'Date Must Be 1/1 or 12/1'
Cancel = True
Exit Sub
Endif

Fred Zuckerman
"Rob" <ro**@physics.umd.edu> wrote in message
news:41***************@physics.umd.edu...
How can I create a validation rule for only allowing
two specific dates but with variable years:

1/1/yyyy or 12/1/yyyy

so only the dates 1/1/2004 or 1/1/1999
or 12/1/2001 etc.
I tried the yyyy but it won't let me do it

You can put it in the Mask property but only one date?

Thanks

Rob

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.