I have a pre-saved static MS Access Report that I am Opening through a Form in MS Access. The User has two options from my Form. Option 1) Simply Open the Saved Report by selecting the Report via a Dropdown Menu (Combo Box) and clicking a button - Works fine!
OR
Option 2) User may click another button giving them some more options. These additional options will provide up to four (4) filter choices for the Report. So, for example, if the report shows sales by employee and the user only wants to see sales by employee, Bill, they can select 'Bill' from an additional 'Employee' pulldown menu (Combo Box). I have this working as long as the user only selects ONE Filter condition.
My issue is that the user needs to be able to select UP TO FOUR (4) filter values, BUT I am having trouble creating a DoCmd.OpenReport command that will allow this. For example, the user may choose to filter on where Employee is 'Bill' and SalesItem is 'Computers'.
The problem is I do not know ahead of time which of the four additional pulldown menus the user is going to select as their filter values. They may select ONLY the first one, leaving the other ones blank, they may select only the second one, they may select the first one, third one and fourth one etc.
Anytime I have a DoCmd.Open Report command with filter values on it that are NOT set, the report opens up with EVERYTHING filtered out (i.e. Blank). Can anyone offer suggestions on how I can simply Filter On the conditions ONLY if the condition is selected from the pulldown menu. (Note: I also don't want like 100 if statements!)
Start Free Trial