MS Access- Validation for post codes

Copper Contributor

 Please help. I've been on this for 3-4 days now!

the postcodes are 4 digits... (data is in short text)

I'm trying to set up a validation rule : is null or like "####" to only enable number input or leave it blank.

 

no matter what I put in... numbers, letters, space... i'm getting the validation msg I set up (please enter 4 digit code)

 

even when I try to change the existing data (short text) same thing...

 

I got an error msg when trying to save this that existing data doesn't match (seriously ... just numbers in short text form)

 

I'm going outta my mind pls help

 

IMG_2858.jpeg

IMG_2859.jpeg

IMG_2860.jpeg

4 Replies
Make it a numeric field (integer) with a rule like: >=1000 And <=9999
Or if you insist on being it a text field, use an input mask: 0000
Yup just resorted to input mask.... 0000;;####

Thank you!

@XPS35 A text field would allow zip codes with a leading zero, and you don't have to remember to format it in output forms or reports.


If, for whatever reason, you don't like to have an input rule, the validation rule could reference any field in the current record. E.g.:

Gerrit_Viehmann_0-1723631771131.png

 

Cheers!