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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to clear search box after leaving the field? 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
My main form that has a combobox that searches for records. When I search for one and then leave the combobox, the title I was searching for still remains in the combobox. I would like it to remove the title OnExit but I am not sure what command to use.

Why do I want to do this? When I go to do a second search (or a third or fourth, etc), I have to take the mouse and highlight the old search item before I can start typing in a new search item. Big pain in the butt.

I thought about the Undo command but if a title was entered and then another search was done, the undo will put the old title back in.
 
Make the last line of the combo-boxes AfterUpdate event something like:

Me!cboFindSomething = Null
 
Hi,
you could try putting the following in the on exit event of the combobox:
Code:
Me.Combo0.SetFocus
Me.Combo0.Text = ""
You'll have to change combo0 with the name given to your combobox.
Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top