Correct formatting of main & subreports Access 2007 (1 Viewer)

Punice

Registered User.
Local time
Today, 08:39
Joined
May 10, 2010
Messages
135
Having a lot of trouble designing a report with a subreport.
First Issue:
Initially, i want to know if I am formatting it correctly. Here is what I have:
Report Header - - Holds the main report title;
Page Header - - - The control header column names for the main report;
===========
Detail - - - - - - - The record data for it
Page Footer - - - Holds the subreport title;
Page Header - - - The control header column names for the subreport;
Detail (2nd) - - - The subreport data.

The report almost displays correctly, except that the main report displays multiple repetitive records. We can work on that problem, after I learn
whether or not I need to format the thing differently from what I am doing now.

I've read & tried the available help, but no joy.
 

plog

Banishment Pending
Local time
Today, 07:39
Joined
May 11, 2011
Messages
11,643
The report almost displays correctly, except that the main report displays multiple repetitive records

Most likely this is an issue with the data source the report is based on. I think you should put aside your Report for now and focus on your queries that feed it--if the data is wrong there it can't but help to be wrong in the report.

So, post sample data from the query/table your report is based on as well as its SQL if a query. Also, tell us why it is not correct for what you want.
 

Punice

Registered User.
Local time
Today, 08:39
Joined
May 10, 2010
Messages
135
When I used the query to display the records for a main report before I added the sub-report the records were displayed correctly.
Before I continue, though, my main concern is still whether or not I am formatting the subreport in the proper places on the report in the design mode.
 

Mark_

Longboard on the internet
Local time
Today, 05:39
Joined
Sep 12, 2017
Messages
2,111
Can you post a sample DB with the report/subreport?
 

Punice

Registered User.
Local time
Today, 08:39
Joined
May 10, 2010
Messages
135
I solved my problem by using a very unprofessional method that i thought I'd try.
I copied the sub-report's page header, where the wizard placed it, to the sub's report header, just below the sub's title.
Then, used the 'Add Existing Fields' tool, to place the matching header data fields to the detail section of the sub-report. I deleted the fields that were the pseudo(?) header fields.
Doing that worked. I guess the old adage from my Fortran days, circa 1960, is still true,
which is 'if if works, it's a good program'. That's why programmers rely on the Q&A department to perform the magic.
This 84 year old EE who has never been trained to be a programmer, is a happy camper and will continue peeling this db development onion until I am finished with it.
Thank you all for helping me. This is my savior furm. It's the best.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 08:39
Joined
Feb 19, 2002
Messages
43,257
The main report query should include ONLY data for the main report. Remove any tables with data that belongs in the subreport.

The Report Header appears once and only once for a report. I almost never use it. The only time is ever use it is if I have something like instructions or an explanation that I need to print only once. I put the report title at the top of the Page Header because I like it to print on every page.

It would be very unusual to put a subreport in the page footer. The Page Footer prints at the end of every page. This is not a logical data break. It is simply, that the report cannot print all the detail items on a single page so it needed to roll to a second page. If there's room to print 20 lines of invoice detail on a page and an invoice has 21 items, the 21st will print on page 2.

I'm going to guess that you might want to add some sorting and grouping once you fix the RecordSource for the main from and perhaps the subreport belongs in a group footer.
 

Users who are viewing this thread

Top Bottom