Textbox Help

  • Thread starter Thread starter gti_jobert
  • Start date Start date
G

gti_jobert

Hi all,

I have a textbox where I want the user to enter a 6 digit
number.....how can I format the text box so it always displays
'100xxxxxx' where x = the 6 digit user input.

TIA guys!
 
Use Format | Cell and use the Custom tab, enter 100###### as a new custom
format to be applied.
 
Private Sub TextBox1_Change()
Static fReEntry As Boolean
If Not fReEntry Then
fReEntry = True
With Me.TextBox1
If Len(.Text) > 1 Then
.Text = Right(.Text, Len(.Text) - 3)
End If
.Text = Format(.Text, """100""0")
End With
fReEntry = False
End If
End Sub


--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)
 
Oops, my bad - it is the textbox you want to display the format that way in,
not a cell which echos the input. I don't believe you can do that type of
custom formatting with the text box.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top