A
AHopper
On a dialog box I allow the user to choose a "JobNumber"
they would like to print a report for. When the click
the "Print Report" command button they are asked if they
want to print only the last page. The report is printing
correctly, however, the report opens and becomes visible
behind the dialog box. Is there any way to keep this from
happening and/or have the report close when it has printed
the last page?
The following is in the "On Click" event.
Dim stDocName As String
stDocName = "SpoilageRemovedAtAnalysisRevised"
Answer = MsgBox("Do you want to print ONLY the last page
of the report?", vbYesNo + vbQuestion)
If Answer = vbYes Then
DoCmd.OpenReport stDocName, acViewPreview, , "[JobNumber]
=[Forms]![SpoilageAnalysisDialogBox]![JobNumber]"
DoCmd.SelectObject acReport, stDocName, False
DoCmd.PrintOut acPages, Reports!
SpoilageRemovedAtAnalysisRevised.[Pages], Reports!
SpoilageRemovedAtAnalysisRevised.[Pages]
Exit Sub
End If
If Answer = vbNo Then
End If
Thank you for your help
Allan
they would like to print a report for. When the click
the "Print Report" command button they are asked if they
want to print only the last page. The report is printing
correctly, however, the report opens and becomes visible
behind the dialog box. Is there any way to keep this from
happening and/or have the report close when it has printed
the last page?
The following is in the "On Click" event.
Dim stDocName As String
stDocName = "SpoilageRemovedAtAnalysisRevised"
Answer = MsgBox("Do you want to print ONLY the last page
of the report?", vbYesNo + vbQuestion)
If Answer = vbYes Then
DoCmd.OpenReport stDocName, acViewPreview, , "[JobNumber]
=[Forms]![SpoilageAnalysisDialogBox]![JobNumber]"
DoCmd.SelectObject acReport, stDocName, False
DoCmd.PrintOut acPages, Reports!
SpoilageRemovedAtAnalysisRevised.[Pages], Reports!
SpoilageRemovedAtAnalysisRevised.[Pages]
Exit Sub
End If
If Answer = vbNo Then
End If
Thank you for your help
Allan