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 Combo Box Selection on refocus

Status
Not open for further replies.

gwog

Technical User
Apr 30, 2003
147
US
Hi,

I'm using Access '97.

I have a form that contains combo boxes with drop down lists.

The users selects 1 drop down box and then clicks a command button that opens a 2nd form with records meeting the criteria from that 1 drop down box.

The 2nd form has an exit button that returns the user to the 1st form.

What I would like to do - is when the user is returned to the 1st form - I want the selection previously made to be cleared out. Or in other words the 1st form to be like is was just opened.

My VBA capabilities are very limited - so the more detailed you can be in an explanation the better.

Sorry this is such a long question.

Thanks in advance for your assistance.

Lisa
 
Try adding this to the "On GotFocus" event for the combo box.


(Combo name).Value = ""
(Combo name).Requery


Replace (Combo name) with the name of your combo box. This isn't the cleanest way to do it, but it should clear the combo box everytime it receives the focus.

LillyPad
 
On the button that opens form2 get it to close form1 then when you go back to form1 it should as you require

Hope this helps
Hymn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top