Subreport Formating

  • Thread starter Thread starter David C. Holley
  • Start date Start date
D

David C. Holley

What is the sequencing of events between a REPORT and any SUBREPORTS
contained therein? I'm trying to figure out when the DETAIL_FORMAT event
for the SUBREPORT fires in relationship to the DETAIL_FORMAT event for
the DETAIL section on the main form.
 
try putting a messagebox in each event, then open the report and see in what
order the message boxes pop up.

hth
 
Or, since having all those message boxes popping up every few seconds can be
very annoying, use Debug.Print to route the details to the Immediate window
<g>
 
Already did DEBUG.PRINT with a variable to count then number of times
the FORMAT and REPORT OPEN events fired. The results didn't make any
sense. The DETAIL FORMAT event for the main form fired 12 times. Even
though there were only 3 records on the main form. Regardless of how I
counted the various records & subforms I couldn't figure out why the
DETAIL FORMAT event fired 12 times.
 
Well I'm not able to do what I was trying to do to being with, but I
still don't understanding some particulars about my original approach
wrote the code below as a test to count the number of times the Format
event fires. The end result is that each individual record is numbered
consecutively 1 to 105 (105 records total) which I take to mean that the
Format event was called 105 times. This works perfectly well when the
report is opened directly from the database window. However, when the
report exists as a SUBREPORT and the main REPORT is opened, the
numbering gets wacked out. Instead of starting 1, the numbering starts
at 5. This suggests that the format event was called 4 additional times.
I have fixed this by using the running sum property of a control.
However, still don't understand why the Detail_Format event of the
subform was called the additional number of times. I fully understand
that based on the GROUPING options, that the event might be called
multiple times before moving on (eg when Access gets to the bottom of
the page), however in my test report there was only 1 record.

Option Compare Database
Dim lngRecordCount As Long
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

lngRecordCount = lngRecordCount + 1
Me.dspRecordCount = lngRecordCount

End Sub
 
a better solution, i'm sure. but i have to admit that the Immediate Window
and Debug.Print have always confused the heck out of me. (that's why you're
giving the good answer, Doug, and i'm giving the "yes, i'm an amateur"
answer. <g> ) would you mind spoonfeeding me some instructions on just
where to put the Debug.Print line, to see what i'm after? tia, tina :)
 
Back
Top