Results 1 to 3 of 3
  1. #1

    Record navigation in a report

    I have a form that I use to set criteria for a query - qryMain. From that form I open a report that uses the query as its recordsource - no problem. From the same form, I also want to be able to open a different report, with an 'On Print' event that includes a procedure that will iterate through the records in qryMain. That report would use the query results to draw items in particular places on the page. Everything I want to do works OK except I can't find how to iterate through the query's records from within the report's procedure. Can this be done from a report ?

    I can achieve the desired result by using the query to make a new table, then open that table as a recordset and move through its records (all from the report's procedure), but as the query is there with all the info I need, I'd like to look at its records directly from the report if possible.

    If I try to open the query as a recordset from the report, I get an error because that instance of the query doesn't see the criteria parameters that it needs (from my form).

    How should I be approaching this ?

    I'm using Access 97 SR-2.



  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Sacramento, California, USA
    Thanked 1 Time in 1 Post

    Re: Record navigation in a report

    There isn't any way to share a query among reports. Each one is going to run the same query over again when you open it. There is a <A target="_blank" HREF=>kludge</A>, posted by Andy Baron on The Access Web, that the uses the Name property of a global recordset variable to pass the same query SQL to more than one report, but it isn't really sharing the query. And it's DAO specific, of course.

    Unlike forms, reports aren't really navigating through records in the way you seem to think. It's a one-way trip, front to back, visiting every stop along the way.

  3. #3

    Re: Record navigation in a report

    Thanks Charlotte

    I know reports aren't really designed to navigate around the records in their recordsource, but wondered if they could. What I'll do is create a temp table from the query then interrogate that table from the report to get the info I need.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts