Restricted Time (of day) Entries on Forms

Ceejay64

Bass Playin' Biker Chick
Local time
Today, 13:39
Joined
Oct 2, 2002
Messages
74
Hi,
I need a little assistance.
I have a db that requires entry of the time of day that someone does a specific job. These are timed issues, and have "stop" times as well as "start" times. Both are entered on the form into text boxes.
How can I code the "stop" time box to be more than 2 hrs, but less than 48 hrs from the time in the "start" box? The bosses would like a messagebox to appear if the worker is out of the time window.
I have tried to search the forum for the answer, but can't figure out the best way to describe the problem for results that are applicable (although I got a ton of returns for the "timer" function - LOL!).
Thanks in advance!
 
You need to be aware that you need to store the Date with the times otherwise it's pointless. If you have the Date then you can simply use the DateDiff() function to determine criteria/rules.
 
I do have a date field, too, for each operation. I will try datediff, although I'm not sure quite how to go about joining it all together. I'm a little wonky with getting the code right. :)
I had to make the date and time fields separate since it will most likely be difficult enough to get some of the users to enter the time alone in correctly (it can't be generated using a built-in function because it generally won't be when the entry is made).
We have quite the range of computer experience in the personnel that will need to use the db. Gotta try to keep it simple.
 
Thi swill convert the two fields to one for calculation purposes:

Code:
CDate([DateField]+[TimeField])

You can then use the DateDiff() however you want.
 
Excellent. I'll give it a try and see if I can get it to work.
Thanks!
 

Users who are viewing this thread

Back
Top Bottom