View Full Version : How do I clear a field after leaving it?


SomeGuy
12-13-2000, 01:23 PM
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.

lmangano
12-13-2000, 03:07 PM
Try this:

Private Sub cboPendDate_Exit(Cancel As Integer)

cboComboBoxNameGoesHere.Text = ""

End Sub

This will clear it out when you leave the control - not sure if that's what you want or not....

SomeGuy
12-13-2000, 05:05 PM
Thanks http://www.access-programmers.co.uk/ubb/smile.gif