writing validation rules

  • Thread starter Thread starter Paul
  • Start date Start date
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?
 
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.
 
Back
Top