J
Jennyrd
I have a multi select listbox that feeds out to a text box so that in the
text box all of the chosen values are separated by "Or", ie: CPC Or MON Or
US. I have tried separating by commas, by Or with ' around the text, by Or
Like and the text box still will not feed into the query to give any results.
If I choose one item from the list box, feed it to the text box and run the
query it works. I even typed in the values to the text box exactly as they
should be with quotes and all and tried running the query, still no results.
Is there something I'm missing?
Here's the code that sends the list box to the text box:
Private Sub Test_Button_Click()
Dim frm As Form, ctl As Control
Dim varItem As Variant
Dim strTemp As String
Set frm = Me
Set ctl = frm!List76
For Each varItem In ctl.ItemsSelected
strTemp = strTemp & ctl.ItemData(varItem) & " Or "
Next varItem
strTemp = Left$(strTemp, Len(strTemp) - 4)
Me![Function_Report] = strTemp
End Sub
This is what I have in the query's criteria line:
Like [Forms]![Report1]![Function_Report]
Thanks for any help you can provide!
-Jenny
text box all of the chosen values are separated by "Or", ie: CPC Or MON Or
US. I have tried separating by commas, by Or with ' around the text, by Or
Like and the text box still will not feed into the query to give any results.
If I choose one item from the list box, feed it to the text box and run the
query it works. I even typed in the values to the text box exactly as they
should be with quotes and all and tried running the query, still no results.
Is there something I'm missing?
Here's the code that sends the list box to the text box:
Private Sub Test_Button_Click()
Dim frm As Form, ctl As Control
Dim varItem As Variant
Dim strTemp As String
Set frm = Me
Set ctl = frm!List76
For Each varItem In ctl.ItemsSelected
strTemp = strTemp & ctl.ItemData(varItem) & " Or "
Next varItem
strTemp = Left$(strTemp, Len(strTemp) - 4)
Me![Function_Report] = strTemp
End Sub
This is what I have in the query's criteria line:
Like [Forms]![Report1]![Function_Report]
Thanks for any help you can provide!
-Jenny