R
RichW
My company issues alpha-numeric employee numbers; for instance, B12345678.
In a form I have created a text field that permits users to input their
employee number, but I wish to prevent them from including the preceding
letter; for instance, employee number B12345678 could only be inputted as
12345678.
As a text field, the field already prevents the user from inputting letters
by having error code 2113 pop into view. The actual error message reads,
"The value you entered isn’t valid for this field.@For example, you may have
entered text in a numeric field or a number that is larger than the FieldSize
setting permits."
I wish to change the above error message to read "Please omit preceding
letter from BEMS ID". I tried the following language, but without luck:
*********************************************
Private Sub txtBEMSID_Click()
On Error GoTo Err_txtBEMSID_Click
Err_txtBEMSID_Click:
MsgBox Err.Description
MsgBox Err.Number
If Err.Number = 2113 Then
MsgBox ("Please omit preceding letter from BEMS ID")
End If
Resume Exit_txtBEMSID_Click
End Sub
*********************************************
Because there are many other text fields in the form, using error handling
for 2113 at form level is not successful for it will result in the same error
message (Please omit preceding letter from BEMS ID) for any text field that
results in error code 2113.
Any ideas?
Thanks in advance,
Rich
In a form I have created a text field that permits users to input their
employee number, but I wish to prevent them from including the preceding
letter; for instance, employee number B12345678 could only be inputted as
12345678.
As a text field, the field already prevents the user from inputting letters
by having error code 2113 pop into view. The actual error message reads,
"The value you entered isn’t valid for this field.@For example, you may have
entered text in a numeric field or a number that is larger than the FieldSize
setting permits."
I wish to change the above error message to read "Please omit preceding
letter from BEMS ID". I tried the following language, but without luck:
*********************************************
Private Sub txtBEMSID_Click()
On Error GoTo Err_txtBEMSID_Click
Err_txtBEMSID_Click:
MsgBox Err.Description
MsgBox Err.Number
If Err.Number = 2113 Then
MsgBox ("Please omit preceding letter from BEMS ID")
End If
Resume Exit_txtBEMSID_Click
End Sub
*********************************************
Because there are many other text fields in the form, using error handling
for 2113 at form level is not successful for it will result in the same error
message (Please omit preceding letter from BEMS ID) for any text field that
results in error code 2113.
Any ideas?
Thanks in advance,
Rich