Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple subreport header problem

Status
Not open for further replies.

EmilGray

Programmer
Nov 7, 2002
4
0
0
US
I'm using Access 2000 and Windows 98. Also I do have the
Master/Child links set up for all of my sub-reports.

I have a report with 15 sub-reports. Each sub-report only
prints if there is available data. If there is data in a
sub-report there are 1 or more records associated with the
sub-report. Each sub-report is constructed thusly.

1. Report Header/Footer containing no objects and 0"
height.
2. Report Page Header/Footer containing no objects and 0"
height.
3. Two group Headers the first of which is
named "Facility" and contains no objects and 0" height.
The second Header is a "Static" Header, that is
named "=2". It contains 1 line and four text boxes that
substitute for Page Header labels and is .5" in height.
4. A Detail section containing three text boxes and one
line under the text boxes.
5. A "Facility" Footer that contains four text boxes for
Summary Data and a "Page Break".
I am attempting to have at least one Detail Record
print/print preview with the "Static" Header labels
mentioned in paragraph 3 above. I used the function
provided in Q210508 "How to Avoid Abandoned Group Headers
in Reports" and placed it in the On Print Event for
the "Static" Header "=2".

Option Explicit

Function PrintOK(R As Access.Report)
If R.Top > (4 * 1440) Then
R.MoveLayout = True
R.PrintSection = False
R.NextRecord = False
End If
End Function

Without the function all of the data prints/print previews
correctly except in several instances the Header
information prints without any detail records at the
bottom of a page. With the function however some very
unusual events occur.

1. The first sub-report prints/print previews just
the "Static" Header and does not print/print preview the
one Detail Record associated for that sub-report nor does
it print the sub-report Footer.
2. The next sub-report that contains data prints/print
previews the "Static" Header and all associated Detail
Records and the sub-report Footer as does the next two sub-
reports that contain data. However, the very next sub-
report that contains data does not print/print preview
it's Header or Detail Record(s) or Footer within the Main
Report. However if you run the sub-report separately all of
the items appear as they should.

I have discovered that Access 2000 is formatting more than
one page at a time preventing the Top property of the
report from changing for each page thus negating
any "benefit" from the function given above and causing
some subreports with data to not print at all. Is this a
bug in Access 2000?

Since all of the data from the sub-reports appear in the
Main Report when not using the function mentioned above I
can only conclude that the function itself is causing the
problem.

Does anyone see a solution to this most frustrating
dilemma?


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top