A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

one table for header/footer data second table for detail



 
 
Thread Tools Display Modes
  #1  
Old May 20th, 2004, 09:31 AM
Nasos
external usenet poster
 
Posts: n/a
Default one table for header/footer data second table for detail

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)
  #2  
Old May 20th, 2004, 11:24 AM
Wayne Morgan
external usenet poster
 
Posts: n/a
Default one table for header/footer data second table for detail

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" wrote in message
...
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)


  #3  
Old May 28th, 2004, 10:46 AM
Nasos
external usenet poster
 
Posts: n/a
Default one table for header/footer data second table for detail

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 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" wrote in message
...
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)



  #4  
Old May 28th, 2004, 07:28 PM
Wayne Morgan
external usenet poster
 
Posts: n/a
Default one table for header/footer data second table for detail

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" wrote in message
...
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.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.