How do I use a combo box in a form to supply an answer for a quer.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Source date: Two tables linked in a query.
Query: Combines the data and allows me to group by products, category & year.
Report: Display the data (once filtered) in a nice format my boss likes.

Problem: I can not work out how to use a combo or list box to allow me to
select products and categories from a finite list which will then pass the
selections to my query and then filter the data for the report.

I have the query promting me to type the data in each time (eg, What Product
do you want?) etc but would like to make it idiot proff and faster
 
Tim,

The easiest approach to this is to put your unbound combobox or listbox
on a form, where the user can select the Product required, and then in
the query, in the place of your existing Parameter prompt, you refer to
the form control, using syntax such as...
[Forms]![NameOfForm]![NameOfControl]

Of course, the form has to be open at the time that the report is printed.
 
Hi Tim

the basic steps to achieving this are:
1. create the query that the report is to be based on
2. use the report wizard to build a report based on the query
3. create the "report options" form - ensuring that i name each control
something easy to find later (ie if its the start date that i want i name
the control startdate) .......this is where you would create two unbound
combo boxes - one for the products and one for the categories
.............. - close & save form
4. return to the query, click in the criteria line of the field that i
need to reference the control on the form
5. click on the expression builder icon on the toolbar
6. go to forms / all forms / find my "report options" form, in the centre
section double click on the form control that i am using as the criteria
do this for all of the criteria that i'm setting
7. close & save query
8. return to the form & put a command button on it to open the report in
print preview mode - close & save form
9. open form, set criteria, click print button

Cheers
JulieD
 
Back
Top