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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use user-defined query in Report??

Status
Not open for further replies.

sjh

Programmer
Oct 29, 2001
263
US
I created a query called "GetRegions", which is (SELECT RegionDesc FROM tblRegion). And I would like to use this query in the Access report to return the list of values.

So I created a text box in the report and in Control Source --> Expression Builder, I selected my query "GetRegions". The expression builder window displays =[GetRegions]![RegionDesc] However, when I try to view my report, a dialog box named "Enter Parameter Value" pops up. What am I doing incorrectly? I just want the list of RegionDesc to be displayed in the report automatically, without entering any parameter values???

Thank you for your help!!

- sjh
 
The report is where the GetRegions query should be entered, and the textbox should have RegionDesc as the control source

Frank J Hill
FHS Services Ltd.
frank@fhsservices.co.uk
 
Hi,
Thanks for your reply. Could you please explain in more detail? Where do I enter the GetRegions query?

I did the following, but I get this error.
Right-click on the Detail section of report -> Select Properties -> Click Event Tab -> On Format -> Choose Expression Builder -> Select "GetRegions" query

When I try to view the report, it says:
"The expression On Format you entered as the event property setting produced the following error: The object doesn't contain the Automation object 'GetFunctionalClass'."

Please help!
-sjh
 
When you open the report in design view make sure you have the property page open as well. At the top of the property page the name should be "Report", in the grid section in record Source use the drop down arrow and select the query "GetRegions". This make the report based on this query.
In the toolbar (next to the Hammer & Spanner) you will see a file called "field List" if you click this, you will see the range of fields available to you from the query.
Selected the RegionDesc and drag it into the detail section of the report. It will come with it's own label and will be complete and ready your formatting to how you want it to look.
Now run the report and all of the Descriptions should appear in a column... we hope!!!!

Frank J Hill
FHS Services Ltd.
frank@fhsservices.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top