I appreciate your help in advance. I am new to most of this and I need a
little assistance. I have searched the web and found some articles etc... I
am just not sure how to apply it to mine because I am unfamiliar with some of
the coding etc.. I understand a very little of what people are saying but I
can't quite put it all together.
I have a form called "reportfilterfrm" in this form I have 3 list box's. On
2 of the list box's multi select is selected to "None" and I have them bound
to the criteria field in my query and that works perfect. The 3rd list box
multi select is set to "Simple" and I am not sure how to get the query to
refrence this.
The query is called "reportfilterqry"
listbox #3 is called [opponent] I would like it to be the criteria for
[opponent] in the "reportfilterqry" It is a text field.
Thanks again for your help. I really appreciate it!
You need to put the results of your selections into a textbox (in this code
that would be txtSelected) and use that in SQL code with an IN clause:
Private Sub lstElevation_Click()
Dim varItem As Variant
Dim strList As String
Dim strSQL As String
With Me!lstElevation
If .MultiSelect = 0 Then
Me!txtSelected = .Value
Else
For Each varItem In .ItemsSelected
strList = strList & .Column(0, varItem) & ","
Next varItem
If strList <> "" Then
strList = Left$(strList, Len(strList) - 1)
End If
Me.txtSelected = strList
End If
End With
strSQL = "Select * From MyTable WHERE ID In (" & Me.txtSelected & ")"
End Sub

Signature
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
> I appreciate your help in advance. I am new to most of this and I need a
> little assistance. I have searched the web and found some articles etc...
[quoted text clipped - 19 lines]
>
> Thanks again for your help. I really appreciate it!
Fipp - 08 Jun 2007 19:31 GMT
Thanks for all your help. How do I get the results of my selection into the
textbox?
Arvin Meyer [MVP] - 12 Jun 2007 23:19 GMT
> Thanks for all your help. How do I get the results of my selection into
> the
> textbox?
This line of code in the snippet does it:
Me.txtSelected = strList

Signature
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com