forms_are_nightmares
Registered User.
- Local time
- Today, 05:35
- Joined
- Apr 5, 2010
- Messages
- 71
I've searched through the old threads and can't find anything that solves my problem. I have multiple conditions that need to run and produce a result. I've tried Case statements and IF ElseIf statements. Essentially, when I run them, nothing happens, though I know data exists to satisfy the conditions. Any help is appreciated.
Here's my code:
If Exterior.Value = "Complete Lawn Care" And Me.statecmbo <> "" And Me.zipcmbo <> "" Then
Me.Filter = "[Vendor State] Like '" & Nz(statecmbo.Value, "") & "*' And [Vendor Zip] Like '" & Nz(zipcmbo.Value, "") & "*' And [Complete Lawn Care] Like '" & Nz(Yes) & "*'"
Me.FilterOn = True
ElseIf Exterior.Value = "Complete Lawn Care" And Me.statecmbo <> "" And IsNull(Me.zipcmbo) Then
Me.Filter = "[Vendor State] Like '" & Nz(statecmbo.Value, "") & "*' And [Complete Lawn Care] Like '" & Nz(Yes) & "*'"
Me.FilterOn = True
ElseIf Exterior.Value = "Irrigation (installation / repair" And Me.statecmbo <> "" And Me.zipcmbo <> "" Then
Me.Filter = "[Vendor State] Like '" & Nz(statecmbo.Value, "") & "*' And [Vendor Zip] Like '" & Nz(zipcmbo.Value, "") & "*' And [Irrigation (installation / repair] Like '" & Nz(Yes) & "*'"
Me.FilterOn = True
ElseIf Exterior.Value = "Irrigation (installation / repair" And Me.statecmbo <> "" And IsNull(Me.zipcmbo) Then
Me.Filter = "[Vendor State] Like '" & Nz(statecmbo.Value, "") & "*' And [Irrigation (installation / repair] Like '" & Nz(Yes) & "*'"
Me.FilterOn = True
EndIF
Here's my code:
If Exterior.Value = "Complete Lawn Care" And Me.statecmbo <> "" And Me.zipcmbo <> "" Then
Me.Filter = "[Vendor State] Like '" & Nz(statecmbo.Value, "") & "*' And [Vendor Zip] Like '" & Nz(zipcmbo.Value, "") & "*' And [Complete Lawn Care] Like '" & Nz(Yes) & "*'"
Me.FilterOn = True
ElseIf Exterior.Value = "Complete Lawn Care" And Me.statecmbo <> "" And IsNull(Me.zipcmbo) Then
Me.Filter = "[Vendor State] Like '" & Nz(statecmbo.Value, "") & "*' And [Complete Lawn Care] Like '" & Nz(Yes) & "*'"
Me.FilterOn = True
ElseIf Exterior.Value = "Irrigation (installation / repair" And Me.statecmbo <> "" And Me.zipcmbo <> "" Then
Me.Filter = "[Vendor State] Like '" & Nz(statecmbo.Value, "") & "*' And [Vendor Zip] Like '" & Nz(zipcmbo.Value, "") & "*' And [Irrigation (installation / repair] Like '" & Nz(Yes) & "*'"
Me.FilterOn = True
ElseIf Exterior.Value = "Irrigation (installation / repair" And Me.statecmbo <> "" And IsNull(Me.zipcmbo) Then
Me.Filter = "[Vendor State] Like '" & Nz(statecmbo.Value, "") & "*' And [Irrigation (installation / repair] Like '" & Nz(Yes) & "*'"
Me.FilterOn = True
EndIF