format field in an Access to show that an entry must be 3 digits

N

nprewitt

I am having so much trouble in Access. How do I set up a rule or input mask
(I'm always confused as to which one I need to choose) which only allows a 3
digit number to be entered. I am using Access 2003.
 
W

Wayne Morgan

Set the Input Mask of the control to

000;;#

The Input Mask Wizard will only work to text and date data type fields and
their associated controls. However, you can create the mask manually for
numeric fields. Place the cursor on the Input Mask box in the Properties
dialog and press F1 for more information on creating input masks.

If the number you type contains leading zeros, the mask will allow them to
be typed, but won't force them to be displayed. To force them to be
displayed, you'll also need to set the Format property of the textbox to

000

Also, if the field is a number field, the leading zeros won't be stored in
the table. If you want them stored in the table, you'll need to make the
field a text data type field. This may cause problems with sort order if you
want to sort on this field, although with the leading zeros, it probably
will be ok.
 
G

George Nicholson

Validation Rules for:

3 Numerical characters in a text field:
Like "###"

A 3 digit number in a numeric field (between 100 and 999):
Between 100 and 999

(Or an Input Mask of: 000)

HTH,
 
N

nprewitt

Wayne, thank you so much. I've studied this "create input mask", but I just
couldn't get it. Thanks again!
 
Top