How to use validation rule for allowing only first day of the month

  • Thread starter Thread starter doyle60
  • Start date Start date
D

doyle60

What can I put in the Validation Rule property of a date text box to
only allow the first day of the month to be entered? I tried
everything and googled and can't quite figure it out.

Also, what do I enter to allow for only the last day of the month? I
suppose it is the above minus one.

Thanks,

Matt
 
What can I put in the Validation Rule property of a date text box to
only allow the first day of the month to be entered? I tried
everything and googled and can't quite figure it out.

Also, what do I enter to allow for only the last day of the month? I
suppose it is the above minus one.

Thanks,

Matt

Regarding > I suppose it is the above minus one.<
If you SUBTRACT 1 day from the 1st day of the month, the last day of
the previous month could be a 28, 29, 30, or 31.
However, if you ADD 1 day to the entered date and it equals 1, then
you know you have entered the last day of that month.

First day of the entered month:
DatePart("d",[ThisFieldName])=1

Last day of entered month:
DatePart("d",[ThisFieldName]+1)=1
 
Yes, thanks. I get it. If you gave me the first one only I probably
would have figured out the second one in time.

Matt
 
Back
Top