Let me explain (i apologise for being long-winded)...
I have a query called qry Queue Filtered SLA Position,
within this query there is a field 'Queue Group'.
I also have a report called rpt Queue Filtered SLA Position
I have a listbox called ListFilter. It's rowsource is equal to qry Queue Filtered SLA Position. The multiselect property is set to 'simple'.
I have the following code in my form :
Expand|Select|Wrap|Line Numbers
- Private Function GetCriteria() As String
- Dim stDocCriteria As String
- Dim VarItm As Variant
- For Each VarItm In ListFilter.ItemsSelected
- stDocCriteria = stDocCriteria & "[Queue Group] = " & ListFilter.Column(0, VarItm) & " OR "
- Next
- If stDocCriteria <> "" Then
- stDocCriteria = Left(stDocCriteria, Len(stDocCriteria) - 4)
- Else
- stDocCriteria = "True"
- End If
- GetCriteria = stDocCriteria
- End Function
Expand|Select|Wrap|Line Numbers
- Private Sub Command2_Click()
- DoCmd.OpenReport "rpt Queue Filtered SLA Position", acPreview, , GetCriteria()
- End Sub
Why, oh why does this message box appear ?? What is the point of making a selection only to have to type it in ?
Your comments/advise is greatly appreciated and needed.