S
Sayth
I have been adding sports time/duration into my database based on a concept
by John W Vinson.
I have it working in the basic, with a few minor gotcha's. Essentially I
have 3 unbound boxes minutes, seconds & hundredths which the user is to input
the time into and the final time entered is to be displayed in a bound field.
Gotcha's
1) If user clicks into bound form field - Error occurs object doesn't
support this property or method - how can I add an on click event to tell
user to type values in boxes provided, instead of invoking the debugger.
2) Time displays in bound field as 62.3 for 1 minute 2 seconds and 30
hundredths which is correct as it is a Currency field General format in the
table can it display to a mm:ss:ms format in the form?
3) If I retype a time for a location and distance that already contains an
entry the form bound field shows the new value but the table value shows old
value. If it matters I want to stop the bound field showing time until all
boxes have been completed and if entry already exists to prompt the user to
accept change using code from here
http://msdn.microsoft.com/en-au/library/bb507728.aspx
This is the code that currently exists.
Private Sub Minutes_AfterUpdate()
Me!TimeDistance = CCur(Nz(Me!Minutes) * 60) _
+ CCur(Nz(Me!Seconds)) + CCur(Nz(Me!Hundredths) / 100)
End Sub
Private Sub Seconds_AfterUpdate()
Me!TimeDistance = CCur(Nz(Me!Minutes) * 60) _
+ CCur(Nz(Me!Seconds)) + CCur(Nz(Me!Hundredths) / 100)
End Sub
Private Sub Hundredths_AfterUpdate()
Me!TimeDistance = CCur(Nz(Me!Minutes) * 60) _
+ CCur(Nz(Me!Seconds)) + CCur(Nz(Me!Hundredths) / 100)
End Sub
Private Sub TimeDistance_Click()
If Not IsNull(Me!TimeDistance) Then
Me!Minutes = Me!Racetime \ 60 Mod 60
Me!Seconds = Me!Racetime - 60 * (Me!Racetime \ 60)
Me!Hundredths = Me!Racetime - 100 * (Me!Racetime \ 100)
End If
End Sub
by John W Vinson.
I have it working in the basic, with a few minor gotcha's. Essentially I
have 3 unbound boxes minutes, seconds & hundredths which the user is to input
the time into and the final time entered is to be displayed in a bound field.
Gotcha's
1) If user clicks into bound form field - Error occurs object doesn't
support this property or method - how can I add an on click event to tell
user to type values in boxes provided, instead of invoking the debugger.
2) Time displays in bound field as 62.3 for 1 minute 2 seconds and 30
hundredths which is correct as it is a Currency field General format in the
table can it display to a mm:ss:ms format in the form?
3) If I retype a time for a location and distance that already contains an
entry the form bound field shows the new value but the table value shows old
value. If it matters I want to stop the bound field showing time until all
boxes have been completed and if entry already exists to prompt the user to
accept change using code from here
http://msdn.microsoft.com/en-au/library/bb507728.aspx
This is the code that currently exists.
Private Sub Minutes_AfterUpdate()
Me!TimeDistance = CCur(Nz(Me!Minutes) * 60) _
+ CCur(Nz(Me!Seconds)) + CCur(Nz(Me!Hundredths) / 100)
End Sub
Private Sub Seconds_AfterUpdate()
Me!TimeDistance = CCur(Nz(Me!Minutes) * 60) _
+ CCur(Nz(Me!Seconds)) + CCur(Nz(Me!Hundredths) / 100)
End Sub
Private Sub Hundredths_AfterUpdate()
Me!TimeDistance = CCur(Nz(Me!Minutes) * 60) _
+ CCur(Nz(Me!Seconds)) + CCur(Nz(Me!Hundredths) / 100)
End Sub
Private Sub TimeDistance_Click()
If Not IsNull(Me!TimeDistance) Then
Me!Minutes = Me!Racetime \ 60 Mod 60
Me!Seconds = Me!Racetime - 60 * (Me!Racetime \ 60)
Me!Hundredths = Me!Racetime - 100 * (Me!Racetime \ 100)
End If
End Sub