F
fhurman
Hello, I apologize in advance for my ignorance. I set up a list box to allow
multiple selected items. I would like to use these selctions as a parameter
in a query and I was able to find some similar posts on this site. I was
thinking of using the language in
http://www.mvps.org/access/forms/frm0007.htm but basically have the results
of this language populate a text box or something that I can then reference
in a query. I tried the following code modified to my situation just as a
test.
Dim frm As Form, ctl As Control
Dim varItem As Variant
Dim strSQL As String
Set frm = Form!Form1
Set ctl = frm!List0
For Each varItem In ctl.ItemsSelected
Text2 = strSQL & ctl.ItemData(varItem) & " OR "
Next varItem
End Sub
My dumb question is what is "Set frm"? I can't seem to figure that one out.
Also, do yuo think the rest of the code will work? I was going to try some
trial and error but got hung up already on the Set frm language.
Thanks for your help,
Mark
multiple selected items. I would like to use these selctions as a parameter
in a query and I was able to find some similar posts on this site. I was
thinking of using the language in
http://www.mvps.org/access/forms/frm0007.htm but basically have the results
of this language populate a text box or something that I can then reference
in a query. I tried the following code modified to my situation just as a
test.
Dim frm As Form, ctl As Control
Dim varItem As Variant
Dim strSQL As String
Set frm = Form!Form1
Set ctl = frm!List0
For Each varItem In ctl.ItemsSelected
Text2 = strSQL & ctl.ItemData(varItem) & " OR "
Next varItem
End Sub
My dumb question is what is "Set frm"? I can't seem to figure that one out.
Also, do yuo think the rest of the code will work? I was going to try some
trial and error but got hung up already on the Set frm language.
Thanks for your help,
Mark