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

Change the input mask depending on another text box

Status
Not open for further replies.

JoshC

IS-IT--Management
Mar 12, 2001
8
US
I am working on a database in which the end user would input address information into a form. How would I go about having the input mask for the Postal Code text box change the input mask depending on the data in the Country text box. In other words, if the address was in the USA, I would want the input mask to read 00000\-9999, but if the address was from Canada, I would want the input mask to read >L0L 0L0. I'm sure it would just take some simple VBA programming to make the adjustment, but I am just beginning to learn VBA, so I would appreciate any help!

Thanks,
Josh C.
 
Josh:
If Me![CountryFieldName] = "Canada" Then
Me![PCodeFieldName].InputMask = "L0L 0L0"
Else
Me![PCodeFieldName].InputMask = "00000\-9999"
End if

Hit F1 in Access and type in "InputMask" and you'll see lots of options!


Gord
ghubbell@total.net
 
Thanks a ton for such a speedy and helpful response! I knew it would be something simple. :O) That was exactly what I needed!
Josh C.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top