Input mask on textbox (1 Viewer)

rphague

New member
Local time
Today, 00:59
Joined
Dec 30, 2020
Messages
4
I'm trying to create an input mask using VBA. The input mask needs to have two possible variations based on the entry in another field. I was able to find some VBA code that is supposed to solve the problem, but it doesn't. The code I have only shows the input mask of the Else condition. Could someone look at it for me and give suggestions. Thank you.

Private Sub Tax_ID_Number_AfterUpdate()

If Me.Tax_ID_Number_Type = "Employer Identification Number (EIN)" Then

Me.Tax_ID_Number.InputMask = "00-0000000"

Else

Me.Tax_ID_Number.InputMask = "000-00-0000"

End If
 

Gasman

Enthusiastic Amateur
Local time
Today, 04:59
Joined
Sep 21, 2011
Messages
14,048
Use F8 and a breakpoint to see what Me.Tax_ID_Number_Type actually contains when you think it should contain Employer Identification Number (EIN)
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:59
Joined
Oct 29, 2018
Messages
21,358
I'm trying to create an input mask using VBA. The input mask needs to have two possible variations based on the entry in another field. I was able to find some VBA code that is supposed to solve the problem, but it doesn't. The code I have only shows the input mask of the Else condition. Could someone look at it for me and give suggestions. Thank you.

Private Sub Tax_ID_Number_AfterUpdate()

If Me.Tax_ID_Number_Type = "Employer Identification Number (EIN)" Then

Me.Tax_ID_Number.InputMask = "00-0000000"

Else

Me.Tax_ID_Number.InputMask = "000-00-0000"

End If
HI. Are you also trying to use Input Mask in Outlook? If not, it may be better to split this topic and create a new one for your issue.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:59
Joined
Oct 29, 2018
Messages
21,358
Just concerned with Access
If no one else does it by the time I get back in front of a computer, I'll split the topic for you.

Sent from phone...
 

Users who are viewing this thread

Top Bottom