3 replies
by stonemethod Accepted solution
by jc2it Accepted solution
The biggest challenge is the data type. I have not worked with Date and Time data types much in Access, other than storing time stamps.
My gut feeling is that you need to use VBA, to program a Case statement. If they do not have Case statements in VBA then you will create a long nested If..Then. The real trick is finding out how to use the data type in this way.
I am surprised you could not find a validation rule for a date field on the net.
If I were doing this I would start with a Field of data type Date/Time then I would build an input format mask. from your example it would be "h:AM/PM". This restricts the data entered to 1 through 12 and AM or PM. Then you are going to need to use VBA to restrict the data even more. There may be a way to do this in the input mask, but I could not find full specs on this.
This link might be helpful
http://www.learnaccessnow.com/chap03a.html
Read the bottom few sections.
From it you might try this:
between 9AM 12PM and between 1PM 4PM
I am not sure it is exactly right though.
Good Luck!
by john.a.wills Accepted solution
VBA does have a case statement, of this form:
Select Case
Case 09:00 to 12:00
'okay
Case 13:00 to 16:00
'okay
Case Else
msgbox "time out of range"
End Select
This discussion is closed to new replies.
Trending Software posts
Sort by Trending