Run query from Report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • crazyhouse
    New Member
    • Aug 2008
    • 31

    #1

    Run query from Report

    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...
    Code:
    SELECT tblHL.[Heat Number]
    FROM tblHL, Table1
    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.
    Last edited by NeoPa; Jan 5 '09, 02:24 PM. Reason: Please use the [CODE] tags provided
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    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?

    Comment

    • crazyhouse
      New Member
      • Aug 2008
      • 31

      #3
      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.
      Last edited by crazyhouse; Jan 7 '09, 01:03 AM. Reason: misunderstood NeoPa's statment

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        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.

        Comment

        Working...