I am using the code that follows to get a list of players names. I am putting the results (players names) in a text box on a form.
I am referencing the text box in the criteria of my query. But, the query doesn't seem to notice the results. Why? Everything works the way I want except the query not accepting it.
Private Sub Command32_Click()
Dim intSalary As Long
Dim varItm As Variant
Dim txtPlayers As String
txtPlayers = "'"
For Each varItm In qbList.ItemsSelected
txtPlayers = txtPlayers & qbList.ItemData(varItm) & "' Or '"
Next varItm
txtPlayers = Left(txtPlayers, Len(txtPlayers) - 4)
Me.qblist2 = txtPlayers
I am referencing the text box in the criteria of my query. But, the query doesn't seem to notice the results. Why? Everything works the way I want except the query not accepting it.
Private Sub Command32_Click()
Dim intSalary As Long
Dim varItm As Variant
Dim txtPlayers As String
txtPlayers = "'"
For Each varItm In qbList.ItemsSelected
txtPlayers = txtPlayers & qbList.ItemData(varItm) & "' Or '"
Next varItm
txtPlayers = Left(txtPlayers, Len(txtPlayers) - 4)
Me.qblist2 = txtPlayers