lucky for you, Access has 3 functions to assist your needs, and they
can be used in queries or in VB under forms to calculate a control to
a value that will update the desired table field.
These fuctions are hour(), minute(), and second(). Each one takes a
date/time OR a string time format, i.e. (like your user's will enter):
"03:45:23".
Then, all you need to do is run these three functions on that field to
achieve your result: hour(<dateORtextField>) * 3600 +
minute(<sameField>) * 60 + second(<sameField>).
That's it.
-Paul T.
fr*******@yahoo.com (fred14214) wrote in message news:<90**************************@posting.google. com>...
I need to be able to enter an elapsed time into a text
field. This time then needs to be converted into seconds
and stored in a field in some table.
The user will enter a time (format is h:minutes:seconds)
as such:
0:15:34 (0 hours, 15 minutes, 34 seconds -> 934 seconds total)
or as another example:
1:02:10 (1 hour, 2 minutes, 10 seconds -> 3730 seconds total)
Can someone please walk me through this? I imagine this is
VBA related (an Event Procedure), but I'm not sure of the
code or what 'Event' type to out this under for the given
text field.
Thanks.