Data Validation in a Form

  • Thread starter Thread starter Alan B
  • Start date Start date
A

Alan B

I have created a data input form and want to validate a dat efield so that it
on;y accepts dates which are saturdays. I tried to use :
=weekday([Date_Fld])=7

But it didn't work. Any advice would be great.

Thanks

Alan
 
In the before Update event of your date field put this
If Weekday([YourDateFieldName]) <> 7 Then Cancel = True
 
Dennis,

Tried that and couldn't get that to work. I changed my tact a little and
put this in the validation rule of the form field:

Weekday([Week Ending])>6

That worked. I'm not sure if it the original issue was because access had
added the extra = at the beginning of the statement and that created an
issue. This obviously only works for Saturday, so it would have to be an AND
statement for another day.

Thanks for your help.

Alan

Dennis said:
In the before Update event of your date field put this
If Weekday([YourDateFieldName]) <> 7 Then Cancel = True

Alan B said:
I have created a data input form and want to validate a dat efield so that it
on;y accepts dates which are saturdays. I tried to use :
=weekday([Date_Fld])=7

But it didn't work. Any advice would be great.

Thanks

Alan
 
Back
Top