I have a form with a list box, set to "Simple" Multi-Selection. I want to be able to filter reports based on the "Items Selected". I can create a VB Function to "gather" the selections but can't seem to "pass" this to the query. Does anyone have an example of how the did this?
This is the function I'm using to test the process.
*************************************************
Function Test() As Variant
Dim varItm As Variant
Dim ctl As Control
Set ctl = Forms![MainMenu]![ServerList]
For Each varItm In ctl.ItemsSelected
strTest = strTest & "'" & ctl.ItemData(varItm) & "' or "
Next varItm
strTest = Left(strTest, Len(strTest) - 4)
End Function
************************************************
This is the function I'm using to test the process.
*************************************************
Function Test() As Variant
Dim varItm As Variant
Dim ctl As Control
Set ctl = Forms![MainMenu]![ServerList]
For Each varItm In ctl.ItemsSelected
strTest = strTest & "'" & ctl.ItemData(varItm) & "' or "
Next varItm
strTest = Left(strTest, Len(strTest) - 4)
End Function
************************************************