one table for header/footer data second table for detail

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I code a report to use one table for its data source in the header/footer sections and another table in the detail
The header footer table contains one record for each report. How can I select the record for the current report? The primary key of the table is the reportname (text 8 chars)
 
One method is to use a subreport. The subreport will have its own record
source. Place the subreport in the detail section. This will allow you to
use the other record source in the report's header and footer.

Another way is with calculated controls. Check the DLookup function and
other aggregate functions (DSum, DCount, etc) for use in the controls.

--
Wayne Morgan
Microsoft Access MVP


Nasos said:
How can I code a report to use one table for its data source in the
header/footer sections and another table in the detail.
The header footer table contains one record for each report. How can I
select the record for the current report? The primary key of the table is
the reportname (text 8 chars)
 
Thanks that works ok, but I have a further problem with the same report, the recordsource for the header/footer section is a table which contains one record for each report available. How can I have a query which will select only the one reecord which I need for the current report using it name? The primary key of the table is the name of the report
repid". Thanks to anyone who can help

----- Wayne Morgan wrote: ----

One method is to use a subreport. The subreport will have its own recor
source. Place the subreport in the detail section. This will allow you t
use the other record source in the report's header and footer

Another way is with calculated controls. Check the DLookup function an
other aggregate functions (DSum, DCount, etc) for use in the controls

--
Wayne Morga
Microsoft Access MV


Nasos said:
How can I code a report to use one table for its data source in th
header/footer sections and another table in the detail
The header footer table contains one record for each report. How can
select the record for the current report? The primary key of the table i
the reportname (text 8 chars
 
Usually, to limit a report this way, you would open a pop-up form first.
Select the option you want, and pass the option to the report.

To pass the selection, there are a couple of options.

1) Hide the form instead of closing it. The selection will now be available
in the query or the report as a parameter. To refer to the selection, use
the path to the control similar to Forms!frmMyForm!txtMyTextbox. Close the
form when you close the report.

To open the form to be used this way, open it in the report's Open event
using the acDialog Window Mode argument in the DoCmd.OpenForm command. This
will cause the report's code to pause until you close or hide
(Visible=False) the form.

2) Open the report from the form. In the DoCmd.OpenReport call pass the
parameter as the WHERE argument of the command.

--
Wayne Morgan
MS Access MVP


Nasos said:
Thanks that works ok, but I have a further problem with the same report,
the recordsource for the header/footer section is a table which contains one
record for each report available. How can I have a query which will select
only the one reecord which I need for the current report using it name? The
primary key of the table is the name of the report "
 
Back
Top