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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Input Mask for CDN/US postal code/zip 1

Status
Not open for further replies.

DajTwo

Technical User
Jul 17, 2008
157
US
Hi all

The Business Unit has requested that I include US Addresses in a specific client table.

In teh corresponding form, I have added the 2 digit US codes for the states to the tbl_provinceand a lookup to determine which country that province/state is. All works well

However the postal code field currently has an input mask of L0L\0L0;0;# and that wont work.

How can I make a conditional input mask depending on the value of the fld_country?

Thanks

If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 

Maybe, in the form's current event, something like this...
Code:
If dlookup("fld_country","tbl_province","state='" & me.txtState & "'") = "US" Then
    me.txtPostalCode.InputMask = "00000-9999;;_"
Else
    me.txtPostalCode.InputMask = "L0L\0L0;0;#"
End If


Randy
 
That gaves me ideas on how to do this, specially the right code !!!

me.txtPostalCode.InputMask

Thanks!!!

If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 
What I did is at the selection of the province, on after update, if country is US then ... as your code states

I did not want to do a lookup but you had the right idea.. THANKS!!!

If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top