Jonathan Kok
Registered User.
- Local time
- Today, 08:36
- Joined
- Jan 27, 2000
- Messages
- 116
I've created a database to track downtime of a machining cell. I've got two fields, stop and start times. The user can enter the times either by hitting a button, in which case it inserts the current date/time, or by typing the time in the field manually.
The trouble I'm having is that it has to track in minutes, and if a user simply types in the current time in the stop/start fields, ie, 2:55 PM, it simply stores the time, and not the date. If the user isn't consistent in using the button vs manual modes, it completely messes up any datediff functions I do (eg. LStopTime = 1/16/2003 12:53:22 PM, LStartTime = 12:56:00 PM, DateDiff("n", LStopTime, LStartTime) = -54197278???)
I imagine I can do some error checking on the BeforeUpdate event, but before I do that, is there any easy way to resolve this?
TIA,
Jonathan
The trouble I'm having is that it has to track in minutes, and if a user simply types in the current time in the stop/start fields, ie, 2:55 PM, it simply stores the time, and not the date. If the user isn't consistent in using the button vs manual modes, it completely messes up any datediff functions I do (eg. LStopTime = 1/16/2003 12:53:22 PM, LStartTime = 12:56:00 PM, DateDiff("n", LStopTime, LStartTime) = -54197278???)
I imagine I can do some error checking on the BeforeUpdate event, but before I do that, is there any easy way to resolve this?
TIA,
Jonathan