G
Guest
Hi -
I have a report which is successfully suppressing the display of selected
records in Print Preview. If the record matches a certain set of criteria, I
set Cancel = True in Detail_Format().
The problem is that after Day 0 (see code below), none of the records print,
even though some can be seen in print preview.
LastDaySameDoseMethylprednisolone is a "global" variable.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Cancel = False
If Me.DoseDate > 0 Then 'i.e., after Day 0.
If Me.Drug = "Methylprednisolone" Then
If Me.DoseDate <= LastDaySameDoseMethylprednisole Then
'Suppress record because it is a duplicate dose.
Cancel = True
Else
'Mark last day of duplicating records for suppression.
LastDaySameDoseMethylprednisole = CheckMethylprednisole()
Cancel = False
End If
End If
End If
End Sub
I've stepped through the above, and it seems to be executing as expected,
except for the part where it previews but does not print. Am I missing
something really basic about how Detail_Format works? Or the Cancel variable?
Thanks in Advance,
Phil Freihofner
I have a report which is successfully suppressing the display of selected
records in Print Preview. If the record matches a certain set of criteria, I
set Cancel = True in Detail_Format().
The problem is that after Day 0 (see code below), none of the records print,
even though some can be seen in print preview.
LastDaySameDoseMethylprednisolone is a "global" variable.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Cancel = False
If Me.DoseDate > 0 Then 'i.e., after Day 0.
If Me.Drug = "Methylprednisolone" Then
If Me.DoseDate <= LastDaySameDoseMethylprednisole Then
'Suppress record because it is a duplicate dose.
Cancel = True
Else
'Mark last day of duplicating records for suppression.
LastDaySameDoseMethylprednisole = CheckMethylprednisole()
Cancel = False
End If
End If
End If
End Sub
I've stepped through the above, and it seems to be executing as expected,
except for the part where it previews but does not print. Am I missing
something really basic about how Detail_Format works? Or the Cancel variable?
Thanks in Advance,
Phil Freihofner