Input mask on textbox

Derek

Registered User.
Local time
Yesterday, 21:06
Joined
May 4, 2010
Messages
234
Hi guys,

I want an input box on the textbox so it will accept only 10 digits. It shouldn't allow users to enter less than or more than 10 digits.

How can I achieve this using vba?

Thanks
 
not input mask,

validation rule: Len([txtBox])=10
validation text: Must be 10 chars
 
I have written the following code and it works fine but is there any way we can display 10 under scores ( like input mask so the users will know they need to enter 10 digits??)

Code:
Private Sub txtAccount1_Change()
Static abort As Boolean
    Static c
   If abort Then: abort = False: Exit Sub
    With txtAccount1
        c = c + 1
         abort = True
        .Text = Left(.Text, 10)
    End With
End Sub
 
Basically 10 underscores (_) should appear on the textbox and it shouldn't allow users to enter more than 10 digits.

Thanks
 
Hi Derek. What’s wrong with using an Input Mask? What have you tried?
 
How can I use input mask to allow 10 digits in a textbox? I just tried the below code which won't let users enter more than 10 digits but I want to show 10 underscores (input mask)

Code:
Private Sub txtAccount1_Change()
Static abort As Boolean
    Static c
   If abort Then: abort = False: Exit Sub
    With txtAccount1
        c = c + 1
         abort = True
        .Text = Left(.Text, 10)
    End With
End Sub
 
Right. You keep saying Input Mask, but you haven’t shown us what you tried in the Input Mask. For example, have you tried? 0000000000;;_

Sent from phone...
 
I'm using outlook VBA and can't see any input mask option in properties for the textbox :(
 
I'm using outlook VBA and can't see any input mask option in properties for the textbox :(
I see. I did not realize that since you posted your question in an Access forum. No wonder I couldn’t understand what the problem was. Unfortunately, I am not familiar with Outlook controls to be able to offer any further suggestions. Good luck.
 

Users who are viewing this thread

Back
Top Bottom