I am building a form that will serve as the source for a report I have written. On the form I have date range options and five multiselect list boxes from which user can select criteria for a report.
Above each list box is a combo box that has a value list populated with all of the fields available for criteria. When the user selects the primary criteria, the secondary criteria box value list is populated with the available fields minus the primary selection and so on through all five list boxes. Easy enough . . .
After the combo box is updated it creates a source for the list box and requeries it. After the primary criteria, I want the list boxes to list only the items as they correspond to the previous list box. Here's an example:
Primary criteria: Client
Clients selected: 462, 559
Secondary criteria: Project
Now in the secondary criteria list box I only want projects that clients 462 and 559 are on. Easy enough . . .
But in the primary criteria combo box I have the possibility of 5 separate criteria selections which makes for serious amounts of possible sql statements when I select a secondary criteria, third criteria, etc. from the remaining list boxes. Is there a way to dynamically create the sql statements based on the selections or will I have to code every possible combination?
Above each list box is a combo box that has a value list populated with all of the fields available for criteria. When the user selects the primary criteria, the secondary criteria box value list is populated with the available fields minus the primary selection and so on through all five list boxes. Easy enough . . .
After the combo box is updated it creates a source for the list box and requeries it. After the primary criteria, I want the list boxes to list only the items as they correspond to the previous list box. Here's an example:
Primary criteria: Client
Clients selected: 462, 559
Secondary criteria: Project
Now in the secondary criteria list box I only want projects that clients 462 and 559 are on. Easy enough . . .
But in the primary criteria combo box I have the possibility of 5 separate criteria selections which makes for serious amounts of possible sql statements when I select a secondary criteria, third criteria, etc. from the remaining list boxes. Is there a way to dynamically create the sql statements based on the selections or will I have to code every possible combination?