J
JohnC
So I'm using a procedure to take separate unbound controls for hours,
minutes, and seconds and storing the computed seconds in a table. This is
what I'm using:
Me.txtRaceTimeSeconds = 3600& * Nz(Me.txthours, 0&) + (60& *
Nz(Me.txtMinutes, 0&) + Nz(Me.txtSeconds, 0&))
This works fine and I can enter hundreds of a second such as 23.23 in
txtSeconds and all is good.
Now when I try to display Hours, Minutes and seconds from the stored Seconds
field I start having problems. Using:
Me.txtHoursMinutesSeconds = Me.txtRaceTimeSeconds \ 3600 & ":" &
Format$((Me.[txtRaceTimeSeconds] \ 60) Mod 60, "00") & ":" _
& Format$(Me.[txtRaceTimeSeconds] Mod 60, "00")
will display everyting properly except if hundreths are entered in seconds,
i.e. 23.23 the hundreths won't display.
I've tried just about everything to get the numbers to the right of the
decimal including:
Me.txtHoursMinutesSeconds = Me.txtRaceTimeSeconds \ 3600 & ":" &
Format$((Me.[txtRaceTimeSeconds] \ 60) Mod 60, "00") & ":" _
& Format$(Me.[txtRaceTimeSeconds] Mod 60, "00") &
Format$(Mid(Me.txtRaceTimeSeconds, Len(Int(Me.txtRaceTimeSeconds * 100)) -
1), "#.00")
but I get an error if seconds are zero using that. And I can't get properly
formated HH.MM.SS.ss if there are no hundreths. It drops the .ss
minutes, and seconds and storing the computed seconds in a table. This is
what I'm using:
Me.txtRaceTimeSeconds = 3600& * Nz(Me.txthours, 0&) + (60& *
Nz(Me.txtMinutes, 0&) + Nz(Me.txtSeconds, 0&))
This works fine and I can enter hundreds of a second such as 23.23 in
txtSeconds and all is good.
Now when I try to display Hours, Minutes and seconds from the stored Seconds
field I start having problems. Using:
Me.txtHoursMinutesSeconds = Me.txtRaceTimeSeconds \ 3600 & ":" &
Format$((Me.[txtRaceTimeSeconds] \ 60) Mod 60, "00") & ":" _
& Format$(Me.[txtRaceTimeSeconds] Mod 60, "00")
will display everyting properly except if hundreths are entered in seconds,
i.e. 23.23 the hundreths won't display.
I've tried just about everything to get the numbers to the right of the
decimal including:
Me.txtHoursMinutesSeconds = Me.txtRaceTimeSeconds \ 3600 & ":" &
Format$((Me.[txtRaceTimeSeconds] \ 60) Mod 60, "00") & ":" _
& Format$(Me.[txtRaceTimeSeconds] Mod 60, "00") &
Format$(Mid(Me.txtRaceTimeSeconds, Len(Int(Me.txtRaceTimeSeconds * 100)) -
1), "#.00")
but I get an error if seconds are zero using that. And I can't get properly
formated HH.MM.SS.ss if there are no hundreths. It drops the .ss