highlight item in textbox

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

Guest

how would I go about have in the value in a textbox highlight if the user
clicks on it? Similar to the way it does when the user uses the tab button
to move between textboxes. I figure that it will have to be done on one of
the events, on enter, on click or on got focus. This is for a quantity
adjustment situation I have on a form and the default value is 0 but if the
user right now just clicks on the box they can unintentionally add or
subtract 10, 20, 230 etc..
 
Figured it out, this is what I came up with. If there is any problems with
this code please let me know, thanks for the help.

Private Sub QuantityAdjustment_Click()
Me.QuantityAdjustment.SelStart = 0
Me.QuantityAdjustment.SelLength = Len(QuantityAdjustment.Text)
End Sub
 

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