Susan Harkins
ssharkins at bellsouth.net
Sun Aug 8 15:48:44 CDT 2004
The following procedure prints a "Missing Record" label in a subreport when
there's a missing AutoNumber value -- I've based this particular example on
the Products table in Northwind. It works fine, except for one thing -- it
prints the subreport label text at the beginning of the Detail section --
before the first record. For the life I've me, I can't seem to shut it up!
The subreport is positioned at the beginning of the Detail section, just
above the actual controls.
Susan H.
'Track record ProductID values.
Public lngMissingRecordFlag As Long
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'If current record isn't one more than flag, print warning.
Dim lngRecordCounter As Long
lngRecordCounter = ProductID.Value
If lngMissingRecordFlag = (lngRecordCounter - 1) Then
Report.rptMissingRecordsub.Visible = False
ElseIf lngMissingRecordFlag <> (lngRecordCounter - 1) Then
Report.rptMissingRecordsub.Visible = True
End If
lngMissingRecordFlag = lngRecordCounter
End Sub