Forum Discussion

SuperYaoms's avatar
SuperYaoms
Copper Contributor
Aug 09, 2024

MS Access- Validation for post codes

 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

 

4 Replies

  • XPS35's avatar
    XPS35
    Iron Contributor
    Or if you insist on being it a text field, use an input mask: 0000
    • SuperYaoms's avatar
      SuperYaoms
      Copper Contributor
      Yup just resorted to input mask.... 0000;;####

      Thank you!
  • XPS35's avatar
    XPS35
    Iron Contributor
    Make it a numeric field (integer) with a rule like: >=1000 And <=9999
    • Gerrit_Viehmann's avatar
      Gerrit_Viehmann
      Copper Contributor

      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.:

       

      Cheers!

Resources