Adding a chart to a report with a parameter query

G

Guest

I have a report that uses a parameter query. The reports lists ProjectName,
ProjectType and FiscalYear with the parameter being FiscalYear. I want to
add a pie chart to this report in the report footer that shows the various
ProjectTypes as a pecentange of all ProjectTypes in a given FiscalYear. The
"Enter Parameter Data" dialog box appears several times and when I get
through all of those boxes the pie chart doesn't display the data correctly.
I found a previous post that suggested creating a separate form dialog box
for entering your parameter data to avoid the multiple appearances of the
dialog box, which I did, but I get the same results. What am I doing wrong?
Thanks,
Jim
 
D

Duane Hookom

Did you replace the parameter in the Record Sources and Row Sources with the
reference to the control on the form? Is the form open before you open the
report?
 
G

Guest

I am a novice Access user so I hope this makes sense. I use the form to open
the report. My "Parameter Form" has a combo box to enter the fiscal year. It
has a "Cancel" button and an "OK" button. The "OK" button uses the OnClick
event which uses Visual Basic's DoCmd.OpenReport, acViewPreview to open the
report that shows projects types by a given fiscal year. The report is based
on a query that references the combo box of the "Parameter Form" as the
Criteria.
So I open the "Parameter Form", enter the fiscal year into the combo box,
click OK, the report opens showing the selected fiscal year. So far so good.
When I move to the next page of the report an "Enter Parameter Value" dialog
box appears showing the location of the combo box control and a text box to
enter the values. I enter the fiscal year and the report moves to the next
page. Same scenario when I move from page to page until I get to the end of
the report.
I hope you understand what is happening. I am using Access 2003. By the
way, I figured out the chart problem.
Thanks for your help.
 
D

Duane Hookom

Do you have any code that closes the "Parameter Form"? It really sounds like
when your report opens, the form is closed.
 
G

Guest

Thanks! That was the problem. I had "DoCmd.Close acForm" as part of my On
Click code. Why do I have to leave the dialog box open? I found that it need
to remain open even when printing the report. Just curious.
 
D

Duane Hookom

I expect you might have a row source that references the same criteria. You
may also have issues if you try to print from the preview window.
 

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