writing validation rules

P

Paul

Have just started working with Access. Having difficulty
writing validation rules. Example: Under Field name I
have Part Number, I've set my Data Type as number. I want
to set my field properties (validation rule) so when a
part number is entered it must resemble

3410-1234BK

4 numbers then a - then 4 numbers then a 2 letter color
code.

How would I setup the fiel properties for this?
 
J

John Vinson

Have just started working with Access. Having difficulty
writing validation rules. Example: Under Field name I
have Part Number, I've set my Data Type as number. I want
to set my field properties (validation rule) so when a
part number is entered it must resemble

3410-1234BK

4 numbers then a - then 4 numbers then a 2 letter color
code.

How would I setup the fiel properties for this?

Well, first off you must change the data type to Text. This data IS
NOT NUMERIC, and you cannot store it in a Number type field.

The appropriate tool for constraining the format is not a validation
rule but an Input Mask. Set the Input Mask property to

0000-0000AA

to require entry of eight numeric digits and two alpha characters.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top