Conditional Input Mask

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

Guest

Is it possible to summon an input mask based on a value in a different control?
Example:
On a form asking for customer data--

If Country is USA, set Postal Code input mask for a US zip code.
If Country is Canada, set Postal Code input mask for a Canadian postal code.
Each additional country set to the appropriate postal code input mask.

What would be the process, if this is possible?
 
Yes it is possible.

You can use something like this:

Select Case Country
Case "USA"
PostalCode.InputMask="00000\-9999;;_"
Case "Canada"
PostalCode.InputMask="" '- Sorry, I do not know the format for Canadian
Zip Codes
Case Else
Perhaps an error message?
End Select

HTH
Jason
 
Thanks! That will do it.
I'm trying to translate minimal Excel VBA skills into Access, and it's slow
going. Thanks again for the help.

tj
 
Back
Top