Requery a combobox using a button

G

Guest

Good morning,

I have a combobox linked to a query that looks up user-entered values. I
have a button that will re-query the combobox, but I want it to automatically
drop down with the new values when the query is entered instead of having to
go over and click the arrow on the combobox.

I tried this code in my button:

Private Sub Command57_Click()
Me.Combo16.Requery
Me.Combo16.Dropdown
End Sub

But it doesn't work. Any suggestions?
 
D

Douglas J. Steele

The combo box needs to have focus for the Dropdown method to work. Try:

Private Sub Command57_Click()
With Me.Combo16
.SetFocus
.Requery
.Dropdown
End With
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

Top