Input Mask problem

aqif

Registered User.
Local time
Today, 11:03
Joined
Jul 9, 2001
Messages
158
Hi
smile.gif


I ma trying to set a Input Mask property and my Rule is that

Only 'W' as letter should be entered at the start and my second rule is that Any letter except 'W' should be entered in the start. I have set my Input mask as

Input Mask = >La

Is there anyway that I can fit my rules in the Input mask. Or I can only check the value at AfterUpdate event.

Is there anyway to generate customised message when a user tries to put a wrong value which is against my input mask?

Cheers!
Aqif
 
I'm a bit confused about your rule, it's not too clear to me, but you might want to check out the InStr function in Access help
 
If you want a custom message, use the before_update property of the control

eg before_update
If Left(me.nameofcontrol,1) <> "W" then
MsgBox "You must start the field with a 'W'",,Left(me.nameofcontrol,1) & "anker!"
cancel = true
ElseIf Mid(me.nameofcontrol,2,1) = "w" or isnumeric(me.nameofcontrol) = True then
MsgBox "Close but not quite. Please make sure that the 2nd character is NOT a w",,"Still not Right"
cancel = true
end if
 

Users who are viewing this thread

Back
Top Bottom