Combobox blank after selection

J

James

I am using the selection of a combo box as a parameter in a query

To update for changes I am using the On Click method of the combobox with me.requer

This refreshes the query correctly but also clears the combobox so you cannot see what I selected
Why is this happening and how can i stop this

James
 
K

Ken Snell

When you requery the combo box's row source, the records must be reobtained
from the recordset and thus the order/content of the list may/can change.

To "go back" to where you were, you'd need to capture in a variable the
value of the combo box (its bound column), then set the combo box equal to
that value after the requery. Something like this should work for you:

Dim varValue As Variant
varValue = Me.ComboBoxName.Value
Me.ComboBoxName.Requery
Me.ComboBoxName.Value = varValue
 

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

Similar Threads


Top