Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input mask to force a dash

Status
Not open for further replies.

hpl2001

Programmer
Dec 18, 2001
105
CA
Is there an input mask I can use to allow entry of only a dash in a certain position? I want to make an input mask for 0000-00000, and I want to allow only a dash to be in that 5th position. I want the dash to be saved with the numbers in the database.

TIA.

Holly
 
If you want digits in each of the ten character positions then I think you've already got the input mask - use "00000-00000" when you set the input mask for the field on your form and make sure that you chose the option to save with the dash.
 
Thanks. Access is formatting my input mask like this:
!0000\-00000

How do choose the option to save with the dash?
 
Select the properties option for your input (text) box. In the 'Data' tab click the 'Input Mask' box and then click the three dots "..." button to open the Input Mask Wizard.

Click the 'Edit List' button and add the input mask as 00000-00000. The zeroes mean a compulsory digit must be added.

Hit the 'Next' button a couple of times and you'll come to the final screen of the wizard which ask if you would like to save with the symbol in the input mask (i.e. your 'dash') or without.

Cheers, Andy
 
The Input Mask

00000-00000

works because the Access Gnomes change it to Holly's

0000\-00000

In Input Masks the Backslash (\) tells Access that the next character is to be included as a literal character.


The Missinglinq

Richmond, Virginia

The Devil's in the Details!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top