How do i change Input Mask default Error Message? (1 Viewer)

Paul Cooke

Registered User.
Local time
Today, 02:21
Joined
Oct 12, 2001
Messages
288
Hi Guys,

After a few hours searching the net I can not find a solution to the problem of changing the message in a default error message box - hopefully there is a solution that someone on here can offer!

I have a date field with a short date input mask on it. if the users enters 6 digits 200111 the field converts that to 20/01/2011 - all of which is fine and working right... but if the user enters less than 6 digits by mistake the "default" error message box pops up

The value you entered isn't appropriate for the input mask '00/00/00;0;'_ specified for this field

Firstly .. is there a way to change the text in this box to make it more user friendly?

And also would it be possbile to explain how it works (If it can be done that is) as I know there will be other "default" messages popping up on other fields as the db design goes on and it would help me learn something hopefully for the future.

Many thanks for any advice offered - please bear in mind I am a novice !!

Thanks

Paul
 

John Big Booty

AWF VIP
Local time
Today, 11:21
Joined
Aug 29, 2005
Messages
8,263
You might find it easier to not allow direct entry of dates but rather use a date picker like the one presented here.
 

Paul Cooke

Registered User.
Local time
Today, 02:21
Joined
Oct 12, 2001
Messages
288
Many thanks for the reply John - there is already a date picker next to the box but no matter how much you tell someone to use it they will usually try to type the date in instead - So I am trying to cover all angles in the revamp design of the DB.

Also there are other "fields" where I expect an error box could pop up so hopefully I can avoid this as well !

Thanks again for the reply

Paul
 

Paul Cooke

Registered User.
Local time
Today, 02:21
Joined
Oct 12, 2001
Messages
288
Just to let you know this has been resolved now

For anyone who needs to know what I found out was that you open the forms properties, make sure you select "Form" in the proerty type drop down box, scrool down to the On Error box and add the following code

Code:
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

Simply put what ever message you want in the MsgBox
 

Users who are viewing this thread

Top Bottom