Zydeceltico
Registered User.
- Local time
- Today, 03:30
- Joined
- Dec 5, 2017
- Messages
- 843
Hi All -
I think this is probably a relatively simple one -- but I can't figure it out yet.
I want to use the following code to provide custom error messages - particularly the one about "this field must be a number"....
This code looks like what I want but I am not sure if it would go on the Load or the BeforeUpdate event of the form:
Thoughts?
Thanks!
Tim
I think this is probably a relatively simple one -- but I can't figure it out yet.
I want to use the following code to provide custom error messages - particularly the one about "this field must be a number"....
This code looks like what I want but I am not sure if it would go on the Load or the BeforeUpdate event of the form:
Code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Select Case DataErr
Case 2113
MsgBox "Only numbers are acceptable in this box."
Response = acDataErrContinue
Case 2237
MsgBox "You can only choose from the dropdown box."
Response = acDataErrContinue
Case 3314
MsgBox "This field is required."
Response = acDataErrContinue
Case Else
Response = acDataErrDisplay
End Select
ActiveControl.Undo
End Sub
Thoughts?
Thanks!
Tim