Validation and Entering Times after Midnight thru a form

Researcher

I.T. Veteran
Local time
Today, 13:14
Joined
Oct 11, 2006
Messages
42
Hello,

I am new to VBA and would like to ask for some help on coding in my database. I am attempting to enter four time entries; Time Printed, Time TIC, Time Processed, and Time PUFC into a table.

What I am having a problem with is when the user enters data into these fields, I need for them to enter times based on the 24 hour clock and would like to have some form of validation to control what they enter. Currently, when they enter times after midnight, the validation no longer works. I also need for them to enter these time sequentially so that my other caluculations work properly.

(Calculations that determine how many minutes there are between these entries, i.e - say Time Printed - Time PUFC). Could someone suggest the best way to setup this scenario.

Below is the validation code I am currently trying to use:

if time tic.value <= time printed.value then
msgbox ("Time TIC is not valid!")
Cancel=True
end if

The validation seems to work until times after midnight are entered, here is the error:


Error.jpg

Any help would be appreciated...

Thank You..
 
Hello:
Make sure in your table design that the Format Section is set to "Short Time"

Regards
Mark
 
If you are working on times past midnight then you will need to store date/time not just time. 00:01 is always going to be before 23:59 with out a date reference

HTH

Peter
 

Users who are viewing this thread

Back
Top Bottom