multiple input masks

JonatABS

Registered User.
Local time
Today, 14:00
Joined
Dec 16, 2002
Messages
114
Ok heres the scoop.

We work with countries all over the world.
There for I have input masks to make it all uniform and consistant.
I can do this real easy with IF statements and it works perfectly.

I was hoping there was an easier method to doing this. Perhaps using Select case statements. If that is indeed the easiest way then I need reteaching how to do them.

Im basing the input mask on what country is selected from a dropdown named COUNTRIES.
The input masks are in text boxes names HOMEPHONE,FAXPHONE and CELLPHONE.

How can I do this?
 
A Select Case would work nicely, I think. Here's the basic syntax:

Code:
Select Case COUNTRIES.Value
     Case 1
          Me!HOMEPHONE.InputMask = YourHomePhoneMask1
          Me!HOMEPHONE.InputMask = YourHomePhoneMask1
          Me!HOMEPHONE.InputMask = YourHomePhoneMask1

     Case 2
          Me!HOMEPHONE.InputMask = YourFaxPhoneMask2
          Me!HOMEPHONE.InputMask = YourFaxPhoneMask2
          Me!HOMEPHONE.InputMask = YourFaxPhoneMask2

     Case 3
          Me!HOMEPHONE.InputMask = YourCellPhoneMask3
          Me!HOMEPHONE.InputMask = YourCellPhoneMask3
          Me!HOMEPHONE.InputMask = YourCellPhoneMask3

End Select

As you probably know, the Value property is whatever value from that combobox you save in the table. My values were 1, 2, and 3. If you were saving Country Names, you'd put Case "CountryName1", etc.

That's just off the top of my head, but hopefully it helps.
 

Users who are viewing this thread

Back
Top Bottom