postal code

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

Guest

Try this ---
[postalcode] Not Like "[a-z]" & "[0-9]" & "[a-z]" & " " & "[0-9]" &
"[a-z]" & "[0-9]"
 
G

Guest

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.
 

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