asp_learner
Registered User.
- Local time
- Today, 15:39
- Joined
- Jun 7, 2001
- Messages
- 46
I just came accross this at http://www.studenthelp.f2s.com/access3.htm
Forcing a weekday
Limiting the type of data you enter doesn't always require a complex event procedure.
Sometimes the Validation Rule property can limit the type of data you enter. For
instance, if you want a control to accept only weekday values, you can enter the
expression
DatePart("w",[field]) Mod 7 >= 2
as the control's Validation Rule property.
Saturday and Sunday return the integers 0 and 1, respectively. Consequently,
checking for a value that's greater than or equal to 2 eliminates any entry that
equals a 0 or 1. Therefore, the control won't accept any date that falls on a
Saturday or Sunday
Forcing a weekday
Limiting the type of data you enter doesn't always require a complex event procedure.
Sometimes the Validation Rule property can limit the type of data you enter. For
instance, if you want a control to accept only weekday values, you can enter the
expression
DatePart("w",[field]) Mod 7 >= 2
as the control's Validation Rule property.
Saturday and Sunday return the integers 0 and 1, respectively. Consequently,
checking for a value that's greater than or equal to 2 eliminates any entry that
equals a 0 or 1. Therefore, the control won't accept any date that falls on a
Saturday or Sunday