Inputformat of fields

D

Dietmar

Hi group,

i have got a stupid problem: In my database there are fields storing
time-information in seconds. The form should display the time as hours
(simple calculate by 3600).

This is not a problem at all;-)

But the problems start because the user should be able to modify the
field (also entering hours) - the value should be stored in seconds
again!

I worked one afternoon on this issue and could not find a solution.
Please - could anyone help me and preseve me from damaging my monitor?

Thanks,
Dietmar
 
K

Klatuu

Here is some basic info that might help. How you use it and where you put it
will depend on the design of the form:
dtmTotTime = TimeSerial(0,0,lngSeconds)
Now lngTotTime will appear as a time, for example, if lngSeconds was 3600,
then dtmTotTime would show as 1:00:00 AM. Never fear, we can convert it to
hours:
lngHours = DatePart("h",dtmTotTime)
lngHours is now 1, so if you want it back to seconds:
lngSeconds = DatePart("h",dtmTotTime) * 3600
 
Top