Rebecca Smith wrote:
I'd like to trap an error if a user inputs a bogus time. The input requires
a short time format. If the user enters someting like 20:78, Access will
catch that but I'd like something of my own.
Thank.
Rebecca
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Use the Form's OnError event to catch the error (2113). The following
is a VERY basic error handler:
Private Sub Form_Error(Data Err As Integer, Response As Integer)
If DataErr = 2113 And Screen.ActiveCo ntrol.Name = "TimeInput" Then
MsgBox "Invalid Time" & vbcr & _
"The Hours must be 0 to 23 and the Minutes must be 0 to 59"
End If
End Sub
--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQioNvoechKq OuFEgEQJ+yACaA+ qHh/va9Z/3hLwZAMF5BEPaGD wAn2aZ
c7HJuNhgTNramXJ ciXTpSLgN
=QiJN
-----END PGP SIGNATURE-----