Hi,
i would be very happy, if someone could give me some advise, because I am stuck for a while...
I want to filter my results into a report. I have some listboxes in a form, one of them is strContractcity. This one is to be copied to strContactcity2 and strContractcity3.
(For ex. strContractcity = "New York", then strContractcity2 and strContractcity3 will be automatically "New York". But I want them filter to look for
strContractcity = "New York" OR
strContractcity2 = "New York" OR
strContractcity3 = "New York"
But like now, all the strContractcities works, but the rest (cities, zone_name, zone_letter, Contacttype, name) doesn't work.
Thanks a lot!!
Stefan
Here is a piece of the code:
---------------
For Each varItem In Me.lstcontractcity.ItemsSelected
strContractcity = strContractcity & ",'" & Me.lstcontractcity.ItemData(varItem) _
& "'"
Next varItem
If Len(strContractcity) = 0 Then
strContractcity = "Like '*'"
strContractcity2 = "Like '*'"
strContractcity3 = "Like '*'"
Else
strContractcity = Right(strContractcity, Len(strContractcity) - 1)
strContractcity = "IN(" & strContractcity & ")"
strContractcity2 = strContractcity
strContractcity3 = strContractcity
End If
---------------
strFilter = ("[cities.city] " & strCity & _
" AND [client] " & strName & _
" AND [zone_name] " & strZone & _
" AND [zone_letter] " & strCode & _
" AND [ContactType] " & strCategory & _
" AND [name] " & strManager)
strFilter = (" [contractcity.city] " & strContractcity & _
" OR [contractcity2.city] " & strContractcity2 & _
" OR [contractcity3.city] " & strContractcity3)
------------
i would be very happy, if someone could give me some advise, because I am stuck for a while...

I want to filter my results into a report. I have some listboxes in a form, one of them is strContractcity. This one is to be copied to strContactcity2 and strContractcity3.
(For ex. strContractcity = "New York", then strContractcity2 and strContractcity3 will be automatically "New York". But I want them filter to look for
strContractcity = "New York" OR
strContractcity2 = "New York" OR
strContractcity3 = "New York"
But like now, all the strContractcities works, but the rest (cities, zone_name, zone_letter, Contacttype, name) doesn't work.
Thanks a lot!!
Stefan
Here is a piece of the code:
---------------
For Each varItem In Me.lstcontractcity.ItemsSelected
strContractcity = strContractcity & ",'" & Me.lstcontractcity.ItemData(varItem) _
& "'"
Next varItem
If Len(strContractcity) = 0 Then
strContractcity = "Like '*'"
strContractcity2 = "Like '*'"
strContractcity3 = "Like '*'"
Else
strContractcity = Right(strContractcity, Len(strContractcity) - 1)
strContractcity = "IN(" & strContractcity & ")"
strContractcity2 = strContractcity
strContractcity3 = strContractcity
End If
---------------
strFilter = ("[cities.city] " & strCity & _
" AND [client] " & strName & _
" AND [zone_name] " & strZone & _
" AND [zone_letter] " & strCode & _
" AND [ContactType] " & strCategory & _
" AND [name] " & strManager)
strFilter = (" [contractcity.city] " & strContractcity & _
" OR [contractcity2.city] " & strContractcity2 & _
" OR [contractcity3.city] " & strContractcity3)
------------