Combo box selection becomes part of query

  • Thread starter eaweitz@townispcom
  • Start date
E

eaweitz@townispcom

I have 6 combo boxes on a form. I want to run a query
that will print out a report, based on the selection made
from the combo box. The problem I have is how do I take
the selected result of a combo box, and use that value in
a query to print a report. Each combo box has it's own
table.
 
J

John Vinson

I have 6 combo boxes on a form. I want to run a query
that will print out a report, based on the selection made
from the combo box. The problem I have is how do I take
the selected result of a combo box, and use that value in
a query to print a report. Each combo box has it's own
table.

If the Form is named MyForm, and has combo boxes cboOne, cboTwo and so
on, use a Query with

=[Forms]![MyForm]![cboOne]

on the field that cboOne should search, and similarly for the
remaining combos.

The Bound Column of the combo should be the value that you're
searching for for the report; the Form should be *unbound*, as should
all the combo boxes (their Control Source properties should all be
blank); and you should consider putting a button on the Form to launch
the report. It's not necessary to open the query window at all if the
report is based on the query.

John W. Vinson[MVP]
 

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