Breaking Up Text (Numbers)



Hi all,

I'm a bit stuck with this one... I have a field in which I type three
sets of numbers in the format 43601-078-00038, and the input mask I use
defies logic - but works!

The input mask is:


Trust me, it works. But the end result I am trying to achieve is an
entry in the table that reflects the hyphens used. Presently the
number is stored as 4360107800038. I just want it stored in (text
field within) the table as 43601-078-00038.

it's stored as text because there is sometimes an instance of
43601-abc-00038 too.

Any help appreciated


Graham Mandeno

Hi Pete

If you add ;1 to the input mask then the "extra" characters in the mask will
be stored along with what the user typed in.


According to A2K help, (for the second section of the Inputmask property)

"If you use 0 for this section, all literal display characters (for example,
the parentheses in a phone number input mask) are stored with the value; if you
enter 1 or leave this section blank, only characters typed into the control are

So the input mask should be "AAAAA\-AAA\-AAAAA;0" (without the quotes)

Using this mask, you won't have to type in the hyphens, but they will be stored
with the entry.

If all places are required to be entered and can be letters or numbers, use
"A". Letters will be the case that you entered them (lower case or upper case)

If only the three middle places can be letters, use

"00000\-AAA\-00000;0" (without the quotes)

Check help for Inputmask property" for more options.


Graham Mandeno

Hi Steve

Quite right! My failing memory told me it was the other way around.

Moral of the story: if you never use a feature yourself, always look it up
in the help before shooting your mouth off :)

Thanks for the heads-up.

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