Criteria

  • Thread starter Thread starter Tom Antrim
  • Start date Start date
T

Tom Antrim

Hello
Can you get a combo box in a query's criteria? I used the
field properties and clicked on the Lookup tab and filled
it out. Instead of filling in the [What Name] in the
criteria I thought I could choose a name off of a Combo
box list.
 
hi,
yes you can.
in your query's criteria put
[forms]![yourform]![combobox1]
the query will go looking for your form and combo box and
use whatever in in the combo box as criteria. the form has
to be open and the combo box fill in or you get a blank
query results.
good luck.
 
Hi
What I was wanting was the Combo Box to give me a choose
in the criteria. I tried your idea but want to see the
list when I open a report.
-----Original Message-----
hi,
yes you can.
in your query's criteria put
[forms]![yourform]![combobox1]
the query will go looking for your form and combo box and
use whatever in in the combo box as criteria. the form has
to be open and the combo box fill in or you get a blank
query results.
good luck.
-----Original Message-----
Hello
Can you get a combo box in a query's criteria? I used the
field properties and clicked on the Lookup tab and filled
it out. Instead of filling in the [What Name] in the
criteria I thought I could choose a name off of a Combo
box list.
.
.
 
Hi
What I was wanting was the Combo Box to give me a choose
in the criteria. I tried your idea but want to see the
list when I open a report.

The idea works. In fact it's very commonly used.

The trick is to open the Report *FROM THE FORM*. Open the criteria
form first; have a command button on it which opens the report, which
is based on a query referencing the form.

John W. Vinson[MVP]
 
Hello
Here is what I did.. I placed the form in the query
criteria and made a macro to open the that query and also
open the report. I placed the macro in the event procedure
of the form with the list. I placed the form in the
switchboard so when the menu is selected and one of the
records selected it opens the report filtered through the
query. Thanks for the tip. It works great.
 
Hello
Here is what I did.. I placed the form in the query
criteria and made a macro to open the that query and also
open the report. I placed the macro in the event procedure
of the form with the list. I placed the form in the
switchboard so when the menu is selected and one of the
records selected it opens the report filtered through the
query. Thanks for the tip. It works great.

You can (and should) leave out the step of opening the query. If the
Report is based on the Query, simply open the Report - it will find
and use the query, there's no need to open it separately.

John W. Vinson[MVP]
 
Back
Top