Help display unbound combo

F

Fjordur

Hi,
I have a form with an unbound combo that lets the user filter data. The
combo RowSourceType = Value List, with 3 values, empty string with label
"don't care", -1 with label "yes", 0 with label "no".
The update event of the combo calls the following code:
Public Sub requeryThisForm()
s = CurrentDb.QueryDefs("MyBasicSelectQuery").SQL
If Not IsNull([ComboName]) Then
' modify s according to the value of the combo...
Me.RecordSource = s & ";"
End Sub
This works fine for filtering the data BUT the combo doesn't display the
chosen value properly. More precisely:
- if I choose "don't care" the combo is always empty
- if I choose yes or no
- - if I choose the same option twice, the combo is empty the first time
and displayed the second time and next times
- - whenever I choose a different option, the display is empty until I
choose the same option again.
I guess it has something to do with the requery that's triggered when I
modify the RecordSource .
How do I get the combo to display the chosen option? Thanks.
 

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