More the one input mask on a field (1 Viewer)

Rusty

Registered User.
Local time
Today, 23:22
Joined
Apr 15, 2004
Messages
207
Hey Guys,

Long story on this but I need a reference number field to be limited to either 6 or 7 characters. Any ideas how to implement 2 input masks on a single field.

Obviously all I have at the moment is "000000" in the Input Mask section but not sure how to put a second one in there.

Any help would be gratefully received.

Cheers,

Rusty
:D
 

johndoomed

VBA idiot
Local time
Today, 15:22
Joined
Nov 4, 2004
Messages
174
A posible workaround that I use, would be to use the "after update" event, and check the field using vba.

At least a suggestion.
 

RuralGuy

AWF VIP
Local time
Today, 16:22
Joined
Jul 2, 2005
Messages
13,825
You should really use the BeforeUpdate Event for field validation. You then simply set Cancel = True if you do not like the input and hold the focus in the control.
 

Rusty

Registered User.
Local time
Today, 23:22
Joined
Apr 15, 2004
Messages
207
Thanks guys :D

I work a lot in VBA, but how do I check the field using vba?

Rusty
:D
 

RuralGuy

AWF VIP
Local time
Today, 16:22
Joined
Jul 2, 2005
Messages
13,825
I personally dislike input masks. Why not tell us the field requirements and we'll come up with the BeforeUpdate code for you. You could use the ControlTip Text to let the user know how to complete the field properly.
 

Rusty

Registered User.
Local time
Today, 23:22
Joined
Apr 15, 2004
Messages
207
Cheers dude.

The field is a text field that needs to have either a 6 or 7 digit numerical value put in it.

(The reason it's a text field even though there's a number going in there is that some of them start with a 0, i.e. "012345")

Hope that makes sense.

Rusty
:D
 

RuralGuy

AWF VIP
Local time
Today, 16:22
Joined
Jul 2, 2005
Messages
13,825
"9000000" as a mask would probably be the easiest. "9" says numeric but optional while "0" is numeric but manditory.
 

Rusty

Registered User.
Local time
Today, 23:22
Joined
Apr 15, 2004
Messages
207
Cheers dude.

I went with "0000009" as it's the last digit that's optional.

Many thanks you guys for all your help.

Rusty
:D
 

Users who are viewing this thread

Top Bottom