View Full Version : Changing Input Mask


Little_Man22
06-24-2001, 06:20 PM
The current input mask for phone number in my Access Database is !(999)000-0000 resulting in an output of (123)456-7890. However, I would like to space out the characters so that the output resembles the following:
(1 2 3) 4 5 6 - 7 8 9 0
Is there any way to do this? Can you add spaces to the input mask?

Thanks,
Ryan.

Donulus
06-24-2001, 09:22 PM
I'm not sure if I understand your question. If you want the mask to display spaces, you can enclose them in quotes " " = space.

Don

DJBummy
06-24-2001, 10:48 PM
Hi Ryan
You can do pretty much the same thing as for your zip code. Did that work for you?
Use the quotes as Don suggested or the capital C or number 9 wherever you want a space.
If you want more information on this, enter InputMask Property in the index of your help and scroll down to see the characters and there descriptions.

Example: !\(999")"000\-0000; this is what you have now. (123)456-7890
!\(C9C9C9")"C0C0C0\-C0C0C0C0;
The Result is ( 1 2 3 ) 4 5 6 - 7 8 9 0
If there is a better or easier way to do this I am not aware of it.

Good Luck
DJ

Little_Man22
06-25-2001, 06:35 AM
Thanks a lot...that worked perfectly.

Ryan.

Little_Man22
06-25-2001, 08:02 AM
I've actually encountered another problem...

Having only one space in between the characters is not enough to line up the phone number feild correctly. I need about 4 spaces in between each character. If I change the input mask to read CCC0CCC0CCC0CCC-CCC0CCC0CCC0CCC0 it will not recognize the command and simply gives the output in its origional format. Similarly if I enter 0" "" "" "0" "" "" "0"...etc it will not recognize the extra spaces.

Is there a way to add more than one space between the characters so that the final output resembles:
1 2 3 - 4 5 6 7

Thanks again,
Ryan.

DJBummy
06-25-2001, 08:55 AM
Hey Ryan

You need to go to the table in design view and change the field size to a larger number than 50 maybe to something like 100.
There was two things I was wondering.
1.Why do you need so many space between the numbers.
2.Is having this many spaces going to drastically change the size of your database. I'm assuming that spaces are still using up bytes.

Little_Man22
06-25-2001, 11:03 AM
Ok I'll try your suggestion.

The reason that I'm doing this is that I a database full of client information and am seeking to transfer this information onto an application that has been imported into Access and currently serves as the background for my report. I am trying to get the fields that I have in my database to line up with the proper place on the application so that when I print the report last name, first name, phone number, etc. line up with the slot on the application, thus, giving me a completed application for each individual in my database.

I hope it works!!! http://www.access-programmers.co.uk/ubb/smile.gif

Little_Man22
06-25-2001, 11:44 AM
Hey DJ,

I tried it but it still wont come up with the spaces when I print the document. For a 7 digit phone number the input mask currenlty looks like:
!0CCC0CCC0CCC0CCC0CCC0CCC0

Any other ideas?

DJBummy
06-25-2001, 03:36 PM
Hey Ryan

I tried both of these on a test form and report. And they printed out with the spaces and also stored in the table with the spaces. I'm using Access 2000 I don't know if that makes a difference. I don't see why it would. Maybe it has something to do with the background on the report.
If you want the hyphen with the number try this: 0CCC0CCC0CCC\-CCC0CCC0CCC0CCC0;0;
If not try this: 0CCC0CCC0CCC0CCC0CCC0CCC0;0;
Like I said before there is probably a better way to do this that I am not aware of. It may have something to do with using comma delimited characters in visual basic. But that is beyond my scope. Then again if it works use it until something better comes along.

Little_Man22
06-25-2001, 05:07 PM
I littereally cut and pasted the code that you had written in your post and it still did not work. It's really weird how it will not work for me yet it works in your report http://www.access-programmers.co.uk/ubb/frown.gif

Little_Man22
06-25-2001, 05:20 PM
I figured out a 'cheap' solution to the problem...

Under the text box properties for phone number on my report there is an option for text allignment. If I choose 'distribute' the text will evenly distribute itself to fill in the box (which I can move so that it lines up perfectly with the given slots on the application). Kind of a poor man's solution - but it works http://www.access-programmers.co.uk/ubb/smile.gif

Thanks for all your help.

Ryan.