Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter dialog window will not pass query results to report

Status
Not open for further replies.

gbuchman1

Technical User
Mar 8, 2010
60
US
Hi all,
I have a Sales Details report that is based on a query (Sales Detail query). I know that the query runs properly, because when I run it manually, it runs find. Upon running the report, there is a dialog box that I created that prompts for Location, Start Date and End Date. After I answer these 3 questions, then the problem starts; I get another dialog box that prompts for "Sales Detail Query". Since that is the name of the query that the report is based on, this dialog box should not show up. No matter what I put in the field, the report comes up after that witl all fields showing #Error. What must I do to remedy this so the report will run properly?
 
Please note that I chose the query as the Control Source of my report, and that the fields on the report came from the query. Yesterday, I was able to get the report to run properly on its own, before I created the dialog box and had the report reference this (the Location, Start Date and End Date fields are in the Criteria boxes on their respective fields in the column). So when the report is run, it does properly pull up the Sales Detail Dialog box where the users enter their parameters, but after that it looks like it cannot find the query and therefore produces no results.

In my efforts to fix this, I did delete and recreate the query, but did not recreate the report after that. I also have a Module that has code in it that runs, which I modeled after what I saw in a demo database. Please help me solve this. Thanks!
 
What type of module/code are you running?

IMO, don't ever use parameter prompts for your criteria. Always start with a form that has controls on it for your users to enter/select the criteria.

Duane
Hook'D on Access
MS Access MVP
 
Thanks, Duane for the advice on the criteria. My Sales Detail Dialog form does have controls on it. While waiting, I made a new report and made sure that the event code was correct on it. Once I did that, sure enough, the problem was solved. Now when I click on the report, the Sales Detail Dialog box comes up and prompts for the parameters. When I click the OK box, the report now populates properly. Thought I would let you know right away. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top