postal code problem

wannabepro

Registered User.
Local time
Yesterday, 17:42
Joined
Jan 25, 2005
Messages
102
I'm trying to setup a conditional input mask for the postalcode/zipcode field.

Canada postal code input mask format "00000\-9999;;_"
US Zip code format input mask format "L0L 0L0;0;_"


I've setup the country field, so that CANADA, and USA are the only 2 choices from a drop down menu. I want the input mask to be conditional, and selecting an input mask depending on the country picked earlier.


How do I do it?

I know there are several queries here in regards to this, but I am not really understanding them.
 
No queries needed -

Should use something like this. Hope this'll help.

Assuming you named your country choice list box and postal code text box as lstCountry and txtZipCode respectively. Here is the code that I'd use:

Public Sub lstCountry_AfterUpdate()
If lstCountry = "Canada" Then
ZipCode.InputMask = "00000\-9999;;_"
Else
ZipCode.InputMask = "L0L 0L0;0;_"
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom