The SQL statements work fine for me.
I am trying to provide summary totals based on the selection criteria.
1. Summary Totals by Professional Type for all Regions and ALL Agency Types (Grand Total)
Both Combo1.Value & Combo2 Value is selected to "ALL"
Entered SQL Statement not using variables Agency Type nor Region fields in the statement for summary.
2. Summary Totals by Professional Type for a Specific Region for ALL Agency Types
Combo1.Value = specific Region & Combo2.Value = "ALL"
Entered SQL Statement including Specific Region field in SQL Statement and not including Combo2.Value or Agency field in SQL Statement for summary.
3. Summary Totals by Professional Type for a ALL Regions by a specific Agency Type.
Combo1.Value = "ALL" & Combo2.Value = specific Agency Type
Entered SQL Statement including Specific Agency Type field in SQL statement and not including Combo1.value or Region field in SQL Statement.
4. Summary Totals by Professional Type for a specific region & by a specific Agency Type
Combo1.Value = specific Region field & Combo2.Value=specific Agency Type
Entered SQL Statement including Region Field and Agency Type fields in SQL Statement.
I am using "ALL", which is not found in the underlying table; adding by entering a union query on top of actual combobox values for agency type and Region respectively.
The purpose is for the user to select either one or both and query. I tried to cover the four options the user can take.
I believe the first 3 scenarios worked without a hitch.
The difficulty I am having is when a specific Region and a specific Agency Type to not have records based on the selected criteria. The SQL statements results into no records fiting the criteria selected.
These comboboxes (both) are unbounded, based on union queries as rowsources. (needed to include "ALL" as Selection choice)
In my form code, based on the Statements, do I need to reset the form recordset, or How do I reset the comboboxes again. Each combobox brings in the accepted values for each respective combobox. Now, the form did not bring any results, blank. Once I try to make a selection again on either combobox, the value flashes but the selected value is not visible.
If I re-query again, any the SQL statements results with records that match that criteria, It brings up those records but the combobox still do not show visually the selection criteria.
However, if I go back into the combobox, it somehow knows the value for its respective combobox and has the selection on that value.
I hope I am not bothering you. I just do not know if that process I am using to re-query is appropriate or cause for this problem (I do not think so).
I just think some values of the Combo1.Value & Combo2.Value are not sticking or being orphaned.
Form has no recordsource, only when the Requery is entered.
The Form is only allowed edits, no additions, no deletions.
Any additional Suggestions.
Thanks in advance.