Thanks both but I am still having problems..
When I set the field format to hh:nn:ss and the input mask to 99:99:00 it
seems to display and store the time in hours, minutes and seconds.
I have set the properties on the form to match the table but the value
returned afte data is entered shows am or pm....
What I need to do is the user enters a starting time and an ending time and
I need to calculate the average speed. Below is the code I have been working
with. I started with only hours and minutes input from the user and am trying
to change to the hh:mm:ss. The code works until I get to the seconds part:
Private Sub Time_Exit(Cancel As Integer)
Dim MyETime, MyEMinute, MyEhour, MyESeconds, ETotlTime
MyETime = Me.Time
If [OdometerEnd] = "0" Or [OdometerEnd] = "" Then
[Route#].SetFocus
Else
'Assign a time
MyEhour = Hour(MyETime) 'MyEHour contains hours
MyEMinute = Minute(MyETime) 'MyEMinute contains minutes
MyESeconds = Seconds(MyTime) 'MyESeconds contains seconds
ETotlTime = (MyEhour * 60) + (MyEMinute * 60) + MyESeconds
Me!ETAveSpeed = ([Mileage] / ETotlTime) * 360
[RideTime].SetFocus
End If
End Sub
I get the error at the MyESeconds =
Debugging MyEtime at line 3 shows hh:mm:ss with am/pm
Ken Snell said:
Oops. Sprinks is correct....it's Long Time, not Short Time.
--
Ken Snell
<MS ACCESS MVP>
In the table's design view, set the field's Format to Short Time or enter
hh:nn:ss in the Format property.
--
Ken Snell
<MS ACCESS MVP>
I have a time field that I want to store hh:mm:ss. I can set the custom
format to 99:00:00 and the user can input the time but no matter what I
do
the table only displays hh:mm.
Thank you.