Selections on Report

  • Thread starter AccessQuestions via AccessMonster.com
  • Start date
A

AccessQuestions via AccessMonster.com

What I would like to do is be able to choose from a list of items before a
report is display. I know how to create a query and a report on a query.
However, how do I create a report that will allow be to select from a list or
combo box so I don't have to remember the list.
 
A

Allen Browne

Take a look at this example:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html

There's a downloadable example that shows how to make a search form like
that. The procedure is exactly the same for a report. The difference is that
instead of applying the Filter to the form, you use the filter strin in the
WhereCondition of OpenReport.
 
A

AccessQuestions via AccessMonster.com

Will it matter is my report is using "group by"?

Allen said:
Take a look at this example:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html

There's a downloadable example that shows how to make a search form like
that. The procedure is exactly the same for a report. The difference is that
instead of applying the Filter to the form, you use the filter strin in the
WhereCondition of OpenReport.
 
A

AccessQuestions via AccessMonster.com

So if I want it in a report. Do i just need a report based on the query? Or
do I still need to use the form in some way?
 
A

Allen Browne

The idea is to leave the criteria out of the query. Instead, build the
string to use as the WhereCondition of OpenReport, so the report gets
limited that way.

If the report is based on a Totals query, you can use this technique on the
fields that have Group By in the Total row in query design. You can't use it
for the fields that have Where in the Total row in query design. If you need
to be able to do that, you can either use a mix of both techniques (the
WhereCondition for the Group By fields, and the query parameters for the
Where fields), or you can build the entire SQL statement in the Open event
of the report, and assign it to the report's RecordSource.
 

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