Input Mask Message

  • Thread starter Thread starter bud52
  • Start date Start date
B

bud52

Guest
I am trying to change the message that pops up when a user fails to enter data that matches the required "input mask". e.g. An input mask with 09/09/0000;0;" " which will require the user to enter a 4-digit year displays this message "The value you entered isn't appropriate for the input mask '09/09/0000;0;" "' specified for this field."

Any help is appreciated.

Thanks
 
Go to the table design. Click on the appropriate line. At the bottom of the screen, on the "general" tab there is a line for input masks. Highlight whatever is there and push your delete key.
 
You can trap the error then attach your own message.

' This changes the Input Mask default message******************
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Const INPUTMASK_VIOLATION = 2279
If DataErr = INPUTMASK_VIOLATION Then
MsgBox "There was an input mask violation!"
Response = acDataErrContinue
End If
End Sub

HTH
RDH
 
Input mask error not date

Several threads address generating a custom error message for the form for things like date. Is there a way to generate a custom error message for a specific field that uses an error mask? For example, the ID number must be 7 digits, using leading zeros if necessary. The input mask is 0000000;0 - I do not want the field to be required (which if it was would enable me to use the validation text). The Access message generated is: The value you entered is not appropriate for the input mask... If I use error trapping for the form, with the code number generated for this, my custom error message displays for date/time fields or any field with a length problem. I would like to write something for just this specific field, like you have entered 6 digits, and you must enter 7, using leading zeros if necessary.
 

Users who are viewing this thread

Back
Top Bottom