Dinamic Query Linked to a Dynamic Report

G

Guest

Hello,

I have a query which joins two tables... one contains Results from a school
election, like how many votes each candidate got, and the other has a list
which lists all the classrooms, and to which department it belongs. I set up
a query so I can easily see the results of the election by department.
However, in order to not repeat the name of the department over and over, I
didnt select it in the design view. Now I have a report which shows me the
results of the query. The problem is there are 7 different departments, and
I don´t want to make 7 different reports and 7 different querys...

Is there a way for me to dynamically select the department, and have the app
print the report?

I know how to dinamically change the query through a form... but I dont know
how to apply these changes to a report...
 
J

John Vinson

Is there a way for me to dynamically select the department, and have the app
print the report?

Use a criterion such as

=[Forms]![YourFormName]![YourControlName]

where YourControlName is the name of a control on the form which
contains the department ID.
I know how to dinamically change the query through a form... but I dont know
how to apply these changes to a report...

Simply base the Report on the stored Query. When you open the report
(probably from a command button on YourFormName) it will run the query
and use the parameter you specify; you don't need to "open" the query
nor do you need to change the report.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

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

Similar Threads


Top