Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear Text Box When Tabbed To 2

Status
Not open for further replies.

CAPiTA

Technical User
May 27, 2005
16
US
Is there a function similar to Click that will clear a text box when the user tabs their way to it?

Code:
Private Sub txtTol_Max_Click()
txtTol_Max = Empty
End Sub
 
I think there is a focus function but not positive. You may want to look into that until someone can answer definitively.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Just checked. It is txtTol_Max_GotFocus()

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Yes, there is a GotFocus fucntion

Code:
Private Sub txtTol_Max_GotFocus()
    txtTol_Max.Text = ""
End Sub

You probably don't want this code to be in the click event as it will do the code even if the focus is already in the textbox. For instance, if they want to select a specific word or set of characters, when they click on it to do that, the textbox will clear.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top