Input Mask 0123456789-12

G

Guest

Hello.
I am using Access 2000 I need to create an input mask for numbers like:

0123456789-12

10 numbers a dash and 2 numbers and the first digit to accept Zero's.
Could you help?

Thanks.
Iram
 
J

John Nurick

Hi Iram,

That's not a number, it's a string of digits and should be stored in a
text field. This input mask

0000000000\-00

seems to do what you want. I'd also set the field's Validation rule to

Like "##########-##" Or Is Null
 
G

Guest

Thanks John.
I have two fields with this type of input mask now (thanks to you) and I
just found out that one of the fields will need to be able to accept two
formats:

0123456789-12 (10 digits a dash and two digits)
and
0123456789123 (13 digits straight)

How do I do this?

Thanks.
Iram
 
J

John Nurick

Input masks are not good at handling alternative structures. In this
case I think that this mask will do the job (the # will accept a digit
or a plus or minus sign)

0000000000#00;0

For the validation rule, use

Like "##########[-0-9]##" Or Is Null

I suggest you also add ";0" to the other mask, making

0000000000\-00;0

The ;0 causes the - to be stored with the data and not just superimposed
by the mask.


Look up "InputMask Property" in Help and you'll find that the
 
G

Guest

You are the man.





John Nurick said:
Input masks are not good at handling alternative structures. In this
case I think that this mask will do the job (the # will accept a digit
or a plus or minus sign)

0000000000#00;0

For the validation rule, use

Like "##########[-0-9]##" Or Is Null

I suggest you also add ";0" to the other mask, making

0000000000\-00;0

The ;0 causes the - to be stored with the data and not just superimposed
by the mask.


Look up "InputMask Property" in Help and you'll find that the

Thanks John.
I have two fields with this type of input mask now (thanks to you) and I
just found out that one of the fields will need to be able to accept two
formats:

0123456789-12 (10 digits a dash and two digits)
and
0123456789123 (13 digits straight)

How do I do this?

Thanks.
Iram
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top