Hey
I need some help to search for errors in this code
I have used this code before to search a listbox.
But suddenly i dont get this one to work... it must be some silly error in the code, but i cant see it.
Anyone able to help me?
I dont get any error message when running it.
The listbox just emptys, so i guess the code is wrong and does not filter out what i want.
I need some help to search for errors in this code
I have used this code before to search a listbox.
But suddenly i dont get this one to work... it must be some silly error in the code, but i cant see it.
Anyone able to help me?
Code:
Private Sub txtSearch_Change()
Application.Echo False
Dim strSource As String
strSource = "SELECT BussElev_Table.BussElev_ID, BussElev_Table.[Elev Förnamn], BussElev_Table.[Elev Efternamn], BussElev_Table.[Elev Personnummer], Max(BussA_Table.Ansökningsdatum) AS MaxförAnsökningsdatum " & _
"FROM BussElev_Table LEFT JOIN BussA_Table ON BussElev_Table.BussElev_ID = BussA_Table.BussElev_ID_SK " & _
"GROUP BY BussElev_Table.BussElev_ID, BussElev_Table.[Elev Förnamn], BussElev_Table.[Elev Efternamn], BussElev_Table.[Elev Personnummer] " & _
"Where (BussElev_Table.BussElev_ID Like '*" & Me.txtSearch.Text & "*' " _
& "Or BussElev_Table.[Elev Förnamn] Like '*" & Me.txtSearch.Text & "*' " _
& "Or BussElev_Table.[Elev Efternamn] Like '*" & Me.txtSearch.Text & "*' " _
& "Or BussElev_Table.[Elev Personnummer] Like '*" & Me.txtSearch.Text & "*' " _
& "Or BussA_Table.Ansökningsdatum Like '*" & Me.txtSearch.Text & "*') "
Me.ListPicker.RowSource = strSource
Me.ListPicker.Requery
Application.Echo True
End Sub
I dont get any error message when running it.
The listbox just emptys, so i guess the code is wrong and does not filter out what i want.
Last edited: