Minimum data entry in a field

K

Karine

One of my field is called "employee number".

I want the user to enter his 5 (not 4 or 6) digit employee number.

How do I force a minimum number of digits entered?

Thanks
 
K

Klatuu

Set the Input Maks property to 00000 (five zeros) This will require that 5
numeric digits be entered.
 
A

Allen Browne

To make sure your data is correct, it would be important to choose only
valid employee numbers?

If so, you need a table containing all the employees, with an EmployeeNumber
field.

Then in this table (whatever it is recording), you will create a many-to-one
relation back to the Employee table, using the Relationships window (Tools
menu.) When you create the relation, check the box for Relational Integrity.
Now Access will stop them from entering an invalid number.

For more detail on how to set that up, see this old article:
Referential Integrity can't be that easy!
at:
http://allenbrowne.com/xbase-07.html
 
K

Klatuu

Allen,
I thinks a combination of our solutions is in order. Yours is perfect for
existing employee records, but would not prevent the 4 or 6 digit entry the
OP asked about. Of course, if the field size is defined as 5, then 6 would
not work, but would require additional error handling.
 
Top