postal code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I would like to create a macro which checks the postal code field and
returns a message if the entered information is not in Canadian postal code
format (e.g A2L 3G4).
In designing the macro I can get it to work and display the message "Please
double check the form" for the following condition [postalcode] not like
"[a-z]" . (i.e. entering any letter does not give me my error message, but
entering anything else does).
I tried the following [postalcode] not like "[a-z] # [a-z] " " # [a-z] #"
which seems to always display my custom error message.
 
Try this ---
[postalcode] Not Like "[a-z]" & "[0-9]" & "[a-z]" & " " & "[0-9]" &
"[a-z]" & "[0-9]"
 
Thanks. This does exactly what I wanted.

KARL DEWEY said:
Try this ---
[postalcode] Not Like "[a-z]" & "[0-9]" & "[a-z]" & " " & "[0-9]" &
"[a-z]" & "[0-9]"


Karen said:
Hi,

I would like to create a macro which checks the postal code field and
returns a message if the entered information is not in Canadian postal code
format (e.g A2L 3G4).
In designing the macro I can get it to work and display the message "Please
double check the form" for the following condition [postalcode] not like
"[a-z]" . (i.e. entering any letter does not give me my error message, but
entering anything else does).
I tried the following [postalcode] not like "[a-z] # [a-z] " " # [a-z] #"
which seems to always display my custom error message.
 
Back
Top