Connecting Tech Pros Worldwide Forums | Help | Site Map

Run query from Report

Newbie
 
Join Date: Aug 2008
Posts: 31
#1: Jan 5 '09
I am trying to run a query from a report. I have gotten some help here before on setting up a query. This is what i am trying to run...
Expand|Select|Wrap|Line Numbers
  1. SELECT tblHL.[Heat Number]
  2. FROM tblHL, Table1
  3. WHERE (([hl]=[table1].[hl1]));
In a reported field. Access tells me that anything in the field needs to start with "=", but I tried that too. I do know that i am putting the sql statement in the wrong place. On a form it would go in the record control source..... where does it go on a report.

I will have to repeat whatever works many times for the report (with different fields obviously). Any help would be greatly appreciated.
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,715
#2: Jan 5 '09

re: Run query from Report


Queries referenced in a report should all be included as the RecordSource of the report itself. A repository from where all displayed data can be extracted.

Does that help?
Newbie
 
Join Date: Aug 2008
Posts: 31
#3: Jan 7 '09

re: Run query from Report


Maybe. I dont have very much experience with this. How many queries can i run in the recordsource, and how will i direct them to the proper field on the report. Maybe i dont understand completey. Will i be able to pull from more than 1 table... the recordsource only seems to allow 1 table.
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,715
#4: Jan 7 '09

re: Run query from Report


That doesn't sound like what I was trying to say.

What I meant was to ensure that the query that the report runs off has all the data that will be required within the report. There is no need to run extra queries while the report is running. Indeed that doesn't really make much sense.
Reply