ms-accessms-access-2007validation

MS Access Input Mask for Postcode


Is there a way to set an input mask in MS Access 2007 so that certain elements are optional? UK postcodes can be in a number of formats: LL00 0LL or L00 0LL or even LL00 L00LL. For this particular assignment, I need only worry about the first two formats.

So, is there a way for me to set the input mask so that the first letter is optional?


Solution

  • Found an answer here and can just use the following:

    LA0# oLL

    A defines a letter or digit and # defines a digit or a space and removes the space when inserted into database.