Combobox blank after selection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Back
Top