Experts:
I need some assistance tweaking a process utilizing a listbox.
Please find attached sample database containing the following objects:
1. T01_SourceData (only containing some sample data)
2. Q01_Query
3. Form
Allow me to summarize the current process (which works fine):
- Open "Form" -- the listbox displays all "State" values.
- I then either select "California" (by itself) or I can select "California" and "Texas".
- Then I click "Submit Query" **
- Now, for each selected value in the listbox, a **separate** Excel file was created. This is working great!
** Note: In for the process to work for you, please ensure to create a (temporary) "Reports" folder and then update its folder path in the VBA: ReportPath = "C:\Users\dellc\Desktop\Reports
What I need some help with:
- As previously stated, the listbox dynamically shows distinct "State" values based on "T01_SourceData"
- Also, for each "State" value it will create a separate Excel.
- However, I'd like to tweak the process so that I can also have an **All** value which will include all 11 records when selected.
- So, I'd like my listbox to also include "All" such as:
All
California
Colorado
DC/VA
Delaware
Florida
Texas
Virginia
So, while I want to continue to get 7 separate Excel files (if chosen), I'd also like to get a single Excel (with 11 records) when selecting "All".
My question: First, how can I add the "All" to the dynamic list? And then, I need to have to some IF function where -- when "All was selected -- no criteria is passed into the query.
Thank you,
EEH