Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PostCode Format 2

Status
Not open for further replies.

Ajwebb

MIS
Jul 31, 2003
153
GB
Hi all,

I have a Macro that displays a message box saying "PostCode in Incorrect Format" and i would like this to be displayed if someone puts in a Postcode that is not in the format:

LLN NLL or LLNN NLL or 99999999 or 00000000

L = Letter
N = Numeric

Thanks for Any help

Ant
 
Seems that you're trying to use the same post code field for US and other countries' post codes. You can't set multiple masks, so you'll have to do this with code behind the post code field's AfterUpdate property.

However, this won't be easy. First, you have to allow for 8 characters that can be formatted in many different ways. You'll need code to trap not only all the possible CORRECT formats, but you'll also have to develop code to trap all the INCORRECT possible formats.

Have you checked this field in the Customer table in Northwind? I haven't checked it myself, but do recall that there were international customers in the database so it's possible there could be logic on the related forms.

Jim DeGeorge [wavey]
 
Thanks Jim,

I'll have a look at the Northwinds database now and see what they have done.

Ant

:)
 
Ant
The code for postal codes for different countries is in the BeforeUpdate event in the Suppliers form.

Tom
 
Thanks Jim and Tom,

Found it and have got it work on my database fine.

Would have been trying for ages otherwise.

Thanks Again

Ant

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top