Search As You Type Combo, but with scrollable list i.e. down arrows

6 Views Asked by At

This is Maybeon8's solution but it doesn't fix the problem - as stated

Private Const RecordSQL As String = "SELECT [HH_ID], [DisplayName] FROM _HOUSEHOLDS"

Private Sub ctlSearch_Change() 'filter dropbox as you type Dim rs As Recordset Set rs = CurrentDb.OpenRecordset(RecordSQL & " WHERE DisplayName = '" & ctlSearch.text & "' ORDER BY [DisplayName]")

If (rs.BOF And rs.EOF) Then 'only requery on no exact match
    ctlSearch.RowSource = RecordSQL & " WHERE DisplayName Like '*' & ctlSearch.text & '*' ORDER BY [DisplayName]"
    ctlSearch.Dropdown
End If

End Sub

Please help

Private Sub ctlSearch_Change() 'filter dropbox as you type Dim rs As Recordset Set rs = CurrentDb.OpenRecordset(RecordSQL & " WHERE FileAs = '" & ctlSearch.Text & "' ORDER BY [FileAs]")

If (rs.BOF And rs.EOF) Then 'only requery on no exact match
    ctlSearch.RowSource = RecordSQL & " WHERE " & SearchCombo(ctlSearch.Text) & " ORDER BY [FileAs]"
    ctlSearch.Dropdown
End If

End Sub

But the results disappear when the down arrows are depressed

0

There are 0 best solutions below