Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enforcing time constraints

Status
Not open for further replies.

sonso

Programmer
Oct 16, 2002
49
US
I would like to put a data validation rule that forces [End Time] to be greater than [Start Time] (leaving out for the moment an end time that falls into the next day!). I did put a >![Start Time] in the [End Time] field, and this works for ending time, but if [Start Time] is null upon data entry (and [End Time] is not yet entered) the similar <![End Time] will fail. Would this data validation go on the table object? If yes, how would you enter such a complex validation rule? I suppose that this could then cover the date increment possiblity, too.
 
Try &quot;IIF&quot; function. Add it to your existing expression w/ appropiate args.

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Use the IIF at the field level or table level? Something like (for [Start Time] at the table level:

IIF(is Null,,>![End Time])

Should you use Me! for the field-level validation? Can you do multiple line validations at the table (record) level? If you need to check a bunch of conditions to validate a record...
 
Use this construct at most any level you want. W/o knowing a lot more than I care to know on a pro-bono basis, advice on this is meaningless, other than that given above.

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top