upper limit of "time" entry

ReneeB

Registered User.
Local time
Today, 14:33
Joined
Jan 8, 2014
Messages
23
Can't find an answer to a seemingly easy question... I'm sure you can help o-wise-ones.

How do I put an upper limit on the amount of time allowed in a date/time field?

For example - during a heart procedure a person is exposed to radiation, it will never be more than a total time of 10 minutes. I want to know how much, but I want data integrity so I don't want them to be able to enter more than 10 minutes.


Thanks,
Renee
 
The simplest? Validation rule in that textbox property:
<=10

You can also use the field's BeforeUpdate event, and cancel the update if the value is not to your liking.

BTW: do not use a date/time field for this but just a numerical field. Access does not know timespans (i.e. length of time from some point to another point in time) but only specific dates and timepoints.
 
Ok, that does make sense, thanks.
So if I want min:sec - I have to have 2 data fields and concatenate them when I display/print...?
 
Hmm.. I may have jumped the gun, in that I doubt that anybody gets more than 24 hours of X-ray exposure:D

So for small amounts of time, date/time is OK I guess.. you can abuse it like that (just beware how access stores and perceives times and dates http://support2.microsoft.com/kb/210276)

so ,eg., the validation rule for less than 10 minutes would be

<#0:10:00#
 
Thanks Spikepl.
I tried that and when I entered it the rule converted to <#12:10:00 AM#
then I gave it a try - I got an error message when I tried 9:00 (9 minutes)
so I entered 00:09, which would be 12:09 AM but it displays 9AM instead of 9 minutes. Then I looked at the format and changed it from short time to nn:ss, same thing.
I think I liked your first idea - number fields, I don't have so many of these that I can't do a minute & second field. Unless you have a different solution.
rb
 
Success!!! Thanks so much for your guidance, it really helped. It was a piece of cake when I made them numbers and did a little logical addition :)
Thanks again
 

Users who are viewing this thread

Back
Top Bottom