I have this Code that is supposed let me enter text into a textbox and it is supposed to search down the listbox (lstSongs) and go to the song I am typng in as I type it. It lets me type things into the textbox(txtSongSearch) but the listbox does not search down to the record I type into the listbox.
Private Sub txtSongSearch_Change()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSQL As String
Set db = CurrentDb
strSQL = "SELECT SongRef, [Sort Title], Artist, Album, [St Code], Length, Tempo, " & _
"Rating FROM qrySongsSwitchboard WHERE [Sort Title] = '" & Me.txtSongSearch.Text & "*'"
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)
If rs.RecordCount > 0 Then
rs.MoveFirst
Me!lstSongs = rs!SongRef
End If
rs.Close
Set rs = Nothing
Set db = Nothing
End Sub
Can any one tell what I am doing improperly?? It works when I use it from a table.