A
at
I have a list box on a form that prints a report based off the items
selected. I need to add a second column in the list box and have the report
filter by that criteria also. I got the following code from Allen Browne
awhile ago, however I'm not sure how to add what I need to to get it to
filter by the second column also.
Thanks for any help you can give me.
Here's the code:
'Loop through the ItemsSelected in the list box.
With Me.DrawDate
For Each varItem In .ItemsSelected
If Not IsNull(varItem) Then
strWhere = strWhere & Format(.ItemData(varItem), "
\#mm\/dd\/yyyy\#") & ","
strDescrip = strDescrip & Format(.Column(0, varItem),
"\#m\/dd\/yyyy\#") & ","
End If
Next
End With
lngLen = Len(strWhere) - 1
If lngLen > 0 Then
strWhere = "[InvDate] IN (" & Left$(strWhere, lngLen) & ")"
lngLen = Len(strDescrip) - 2
If lngLen > 0 Then
strDescrip = "DrawDate: " & Left$(strDescrip, lngLen)
End If
End If
DoCmd.OpenReport strDoc, acViewPreview, WhereCondition:=strWhere,
OpenArgs:=strDescrip
selected. I need to add a second column in the list box and have the report
filter by that criteria also. I got the following code from Allen Browne
awhile ago, however I'm not sure how to add what I need to to get it to
filter by the second column also.
Thanks for any help you can give me.
Here's the code:
'Loop through the ItemsSelected in the list box.
With Me.DrawDate
For Each varItem In .ItemsSelected
If Not IsNull(varItem) Then
strWhere = strWhere & Format(.ItemData(varItem), "
\#mm\/dd\/yyyy\#") & ","
strDescrip = strDescrip & Format(.Column(0, varItem),
"\#m\/dd\/yyyy\#") & ","
End If
Next
End With
lngLen = Len(strWhere) - 1
If lngLen > 0 Then
strWhere = "[InvDate] IN (" & Left$(strWhere, lngLen) & ")"
lngLen = Len(strDescrip) - 2
If lngLen > 0 Then
strDescrip = "DrawDate: " & Left$(strDescrip, lngLen)
End If
End If
DoCmd.OpenReport strDoc, acViewPreview, WhereCondition:=strWhere,
OpenArgs:=strDescrip