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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|