Report Query Parameters

M

mromyn

Hi -
I have a Form, that executes a Report based on a Query.

I need to enter several parameters for the report:
Manager
Team
Department
Start Date
End Date

The first 3 are combo boxes. I have set the criteria in the query to
Forms![Run Report]!cboManager. However, it is not using the parameter for
Manager.

Can I have a From that calls a Report based on the Query? Or do the
parameters have to be called out in the Report?

For the Date fields I need to enter a date range and only use records
withing that range.

Also, for each parameter there needs to be a way to include all records if
it is left NULL.

Does anyone have an example of something like this?

Thanks,
Mel
 
A

Allen Browne

See:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html

The example shows how to build a filter string, based on whatever criteria
the user chooses, including a date range. In the end, it applies the filter
to a form, it the process is identical for a report. (You just use the
WhereCondition of OpenReport.)

If you have not done anything like this it will take you half an hour to
download the example database, pull it apart and learn how it works. It is a
technique that's worth learning: it's an approach I use multiple times in
every database I create.
 
M

mromyn

Works like a charm! Thank you!

Allen Browne said:
See:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html

The example shows how to build a filter string, based on whatever criteria
the user chooses, including a date range. In the end, it applies the filter
to a form, it the process is identical for a report. (You just use the
WhereCondition of OpenReport.)

If you have not done anything like this it will take you half an hour to
download the example database, pull it apart and learn how it works. It is a
technique that's worth learning: it's an approach I use multiple times in
every database I create.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

mromyn said:
Hi -
I have a Form, that executes a Report based on a Query.

I need to enter several parameters for the report:
Manager
Team
Department
Start Date
End Date

The first 3 are combo boxes. I have set the criteria in the query to
Forms![Run Report]!cboManager. However, it is not using the parameter for
Manager.

Can I have a From that calls a Report based on the Query? Or do the
parameters have to be called out in the Report?

For the Date fields I need to enter a date range and only use records
withing that range.

Also, for each parameter there needs to be a way to include all records if
it is left NULL.

Does anyone have an example of something like this?

Thanks,
Mel
 

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