Input mask for British postcodes/phone numbers

C

C Tate

Does anyone know where I can obtain an input mask which would work for
British postcodes. I would also like one for British telephone numbers too.
I am trying to design a contacts database. many thanks in advance.
 
D

Dave Jones

Colin,

Not aware of an input masks (although someone might know
different) for the following reasons:
For postcodes, it will depend whether you have contacts in
the London area or not. This is because outside London,
all postcodes are (I think) composed of LLN NLL (e.g. PR9
3HL).Within London you find postcodes like WC1R 5RT and
others like NW9 6HY or N1 5TM. This means that the third
and fourth characters in the first part of the code must
be optional. (I have been caught out with this myself).

The one thing that is constant is that the second part is
always 3 characters.

You have two options:

Fistly, use two text boxes for postcode, one for each
part. In the before update event check that the length of
the string in the second box is 3 characters long and in
the first, the string is >1 and <5 characters.

Secondly use one box and then look for a space (chr32) 4
back from the end of the string and then accept what the
user has typed in for the first part.

Telephone numbers are similar, London is 0207 or 0208 456
9876 whereas outside london codes are five digits e.g.
01704, so again, the fifth digit has to be optional. The
second part varies also with 456 9876 in London, and quite
often a straight six digit number outside London.

Dave
 
J

John Nurick

Hi Colin,

Dave's right. There's no input mask that works for UK postcodes, and
none for UK phone numbers either.

A better approach is to validate the data after it's been entered. At
http://www.mvps.org/access/modules/mdl0063.htm there's a general-purpose
validation function I wrote, complete with an expression for validating
UK postcodes.
 

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