I have the following code. I am wanting to filter a report for a date or dates the user selects. I know I am missing the #. I always have trouble with the date fields. Where would they go. Right now the code treats the field as a string.
For Each varItem In Me.lstDate.ItemsSelected
strDate = strDate & ",'" & Me.lstDate.ItemData(varItem) _
& "'"
Next varItem
If Len(strDate) = 0 Then
strDate = "Like '*'"
Else
strDate = Right(strDate, Len(strDate) - 1)
strDate = "IN(" & strDate & ")"
End If
Any help would be appreciated.
MV
For Each varItem In Me.lstDate.ItemsSelected
strDate = strDate & ",'" & Me.lstDate.ItemData(varItem) _
& "'"
Next varItem
If Len(strDate) = 0 Then
strDate = "Like '*'"
Else
strDate = Right(strDate, Len(strDate) - 1)
strDate = "IN(" & strDate & ")"
End If
Any help would be appreciated.
MV