469,326 Members | 1,613 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,326 developers. It's quick & easy.

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

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
1 1689
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.

Similar topics

2 posts views Thread by Ant | last post: by
2 posts views Thread by SKamholtz | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.