Adding All to a combo box

  • Thread starter karen scheu via AccessMonster.com
  • Start date
K

karen scheu via AccessMonster.com

I need to add ALL to two of three combo boxes on my main form. Each combo
box has an underlying query which selects the unique values from an Orders
Summary Query. How do I add "ALL" as first item in all three combo boxes?
The first combo box, cboDivision lists all unique divisions that are
contained within the orders summary query. The second combo box should
lists all unique status values contained within the orders summary query
with the division filter added.
The third combo box should display all unique orders contained within the
orders summary query with the division filter and the Status Filter added.
If all is selected for the first two combo boxes, then all orders contained
within the orders summary query will be returned.

I'd appreciate any help.
Thanks,
Karen
 
G

Guest

One way is to use UNION querys
If the RowSource SQL for cboDivision is soemthing like
SELECT DISTINCT divisionName FROM qryOrdersSummary ORDER BY divisionName,
then it could be amended to
SELECT "ALL" AS divisionName, 1 AS recType FROM qryOrdersSummary
UNION
SELECT divisionName, 2 FROM qryOrdersSummary
ORDER BY recType, divisionName
By returning a second column, you will be able to code the appropriate
action in the combo's AfterUpdate eventHandler.

Hope This Helps
Gerald Stanley MCSD
 
K

karen scheu via AccessMonster.com

Thank you! Now that I have the all as the first item in the combo boxes, I
need to program the filters. This is the part that I need some guidance.
THe form that contains the three combo boxes is a main form with a
recordsource being a query, qOrderSummary. I also have a subform that is
linked to the main form by Order # (3rd combo box). The subform has a
recordsource called qOrderDetail. This is the behavior that I would like:
User selects division from Combo#1
- If all,
- the main form fills in the summary fields with the first
order within the first division.
- the subform displays the detail for the first order within

- If division selected, the main form fills in the summary fields with
the first order within the selected division.
 
K

karen scheu via AccessMonster.com

Thank you! Now that I have the all as the first item in the combo boxes, I
need to program the filters. This is the part that I need some guidance.
THe form that contains the three combo boxes is a main form with a
recordsource being a query, qOrderSummary. I also have a subform that is
linked to the main form by Order # (3rd combo box). The subform has a
recordsource called qOrderDetail. This is the behavior that I would like:
User selects division from Combo#1
- If all,
- the main form fills in the summary fields with the first
order within the first division.
- the subform displays the detail for the first order within

- If division selected, the main form fills in the summary fields with
the first order within the selected division.
 
K

karen scheu via AccessMonster.com

Thank you! Now that I have the all as the first item in the combo boxes, I
need to program the filters. This is the part that I need some guidance.
THe form that contains the three combo boxes is a main form with a
recordsource being a query, qOrderSummary. I also have a subform that is
linked to the main form by Order # (3rd combo box). The subform has a
recordsource called qOrderDetail. This is the behavior that I would like:
User selects division from Combo#1
- If all,
- the main form fills in the summary fields with the first
order within the first division.
- the subform displays the detail for the first order within

- If division selected, the main form fills in the summary fields with
the first order within the selected division.
 
K

karen scheu via AccessMonster.com

Thank you! Now that I have the all as the first item in the combo boxes, I
need to program the filters. This is the part that I need some guidance.
THe form that contains the three combo boxes is a main form with a
recordsource being a query, qOrderSummary. I also have a subform that is
linked to the main form by Order # (3rd combo box). The subform has a
recordsource called qOrderDetail. This is the behavior that I would like:
User selects division from Combo#1
- If all,
- the main form fills in the summary fields with the first
order within the first division.
- the subform displays the detail for the first order within

- If division selected, the main form fills in the summary fields with
the first order within the selected division.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top