VERY simple Input Mask question (1 Viewer)

JonatABS

Registered User.
Local time
Yesterday, 20:43
Joined
Dec 16, 2002
Messages
114
Ok I got this text field that is to be 8 characters.

However someone of the employees have a 0 infront of their number. If the user puts in the employees number without the 0 I want the system to put the 0 in.

I want this to do the same you do in Excel.

You know if you highlight a cell or column and go to custom formatting you can enter in the number of characters you want in the cell.

If you put in 00000000
the user puts in 1234567
excel puts in 01234567

Thats what I want Access to do fo me but I dont know the proper masking to use.

Thanks for the help.
 

Not A PHB

Registered User.
Local time
Yesterday, 21:43
Joined
Oct 1, 2002
Messages
17
Input Mask

All you need to do is go to the Properties/Data tab of your form and copy this into the input mask line: 00000000;; or you can do the same thing in the field within the table if this is a bound textbox. You can create and save your own input masks by clicking the elipses (...) at the end of the input mask line.

HTH

Lance
 

JonatABS

Registered User.
Local time
Yesterday, 20:43
Joined
Dec 16, 2002
Messages
114
yeah but that wont store that in table.

This is the conclusion that ive come too from viewing other posts on this subject
 

Not A PHB

Registered User.
Local time
Yesterday, 21:43
Joined
Oct 1, 2002
Messages
17
If you place the mask in the table it should work.

Or you can do this before inserting the data in your table.

Right("00000000" & ([user_ID]),8)

You concatenate 8 zeros with your user inputted number which would give you 00000000123 for example then you specify how many characters from the right in this case 8 what your left with is the number entered and any leading zeros to fill up the space. I've tested this inserting into a text field and it works but if you're storing it as an integer it doesn't. I attached the database I used too.

I hope this helps,

Lance
 

Not A PHB

Registered User.
Local time
Yesterday, 21:43
Joined
Oct 1, 2002
Messages
17
Where's my attachment?

Try this again I forgot to zip it first.
 

Attachments

  • mask.zip
    16.1 KB · Views: 127

Users who are viewing this thread

Top Bottom