Report criteria from a table

  • Thread starter Thread starter Phil
  • Start date Start date
P

Phil

HI,

I have a table with about 20 fields and a form that goes
with the table. For one of the fields on the form the
user selects a value from a combo box and the data in the
combo box comes from a second table. How do a produce a
restricted report where the user makes a selection based
on the values in my second table. In other words when the
user clicks on the report command button, I want the
values in the second table to appear and when the user
selects a value, only matching records of my main table
will be in the report.

I would think this is possible, but I don't know.

Thanks,
Phil
 
Hi Phil

one way to approach it is
1. create a query based on your table 1 with the fields that you want to
see in your report
2. use the report wizard to build a report based on this query
3. create a "report options" form - make it an unbound form but add a
combo box that takes its row source values from the field in your table2
(name this field something recogisable) - close & save form
4. return to the query, click in the criteria line of the field that you
want to reference to the control on the form
5. click on the expression builder icon on the toolbar
6. go to forms / all forms / find the "report options" form, in the
centre section double click on the form control that will provide the
criteria for the query
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, choose the value from the combo box, click the print button

Let me know how you go.

Cheers
JulieD
 
Thanks Julie,

I must be missing the boat somewhere. When I click on the
command button I get a input window with the title
of "Form!type_option!combo2" (combo2 is my field name).
There is no drop down box. In your step 2 you stated
create a "report options" form. Is this a special form
type or is it just a form with a combo box in it?

I tried all the options I could think of.

Thanks,
Phil
 
Hi Phil

the report option form is just a form with combo boxes of the information
that the users can choose from. Create a new form in design view, and use
the combo box wizard (toolbox icon - make sure the wand & stars is indented
& then select the combo box control) .. .use the wizard to populate the
combo box from your second table.

I have a sample database of a report based on a date range criteria that
shows how this process works - it doesn't have a combo box in it but
everything else is the same - if you'ld like it just email me direct (and by
then i might have time to do a combo box one too).

Cheers
JulieD

julied_ng at hcts dot net dot au
 
Back
Top