Checking Data Field For Week Days Only
The Validation Rule property is one way to 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 will 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 0 or 1. Therefore, the control won't accept any date that falls on a Saturday or Sunday.
This will allow you to present data that only falls on a weekday such as from Monday through Friday.
Just click on the button for the Tiproom's Home Page.
Date of last revision: 17 August 2001.