I have a form "Reports" with thirty labels, each label contains a report. When one of the labels is selected it opens a popup "PUReports" and then the specific report. On the popup are two buttons. Print or Close. If they select print, it should print the report, close the report, close the popup and return to the "Reports" form. If they select close, it closes the popup and the report.
My problem is that when they select print, it is either (depending on my code) printing the popup itself, or the "Reports" form (like I did a print screen). I cannot get it to print the actual report that is opened. I have not yet, but in the end would like to take away all toolbars, buttons, etc. so only the report and popup is showing so they have to answer the popup only.
Here is the code I have so far:
Private Sub Label1_Click()
REM Close the popup
DoCmd.Close
REM Open Module that prints report
Call PrintReports
REM Open Module closing all reports
Call CloseOpenReports
REM Return to Reports Form
DoCmd.OpenForm "ReportsMenu", acNormal
REM Maximize reports form
DoCmd.Maximize
End Sub
MODULE (this module is the same as close reports except for the DoCmd line)
Sub PrintReports()
Dim rpt As Report
' Enumerate Open Reports in collection.
For Each rpt In Reports
DoCmd.PrintOut (acPrintAll)
Next rpt
End Sub
Any help or suggestions would be greatly appreciated.
Janet Lyn
My problem is that when they select print, it is either (depending on my code) printing the popup itself, or the "Reports" form (like I did a print screen). I cannot get it to print the actual report that is opened. I have not yet, but in the end would like to take away all toolbars, buttons, etc. so only the report and popup is showing so they have to answer the popup only.
Here is the code I have so far:
Private Sub Label1_Click()
REM Close the popup
DoCmd.Close
REM Open Module that prints report
Call PrintReports
REM Open Module closing all reports
Call CloseOpenReports
REM Return to Reports Form
DoCmd.OpenForm "ReportsMenu", acNormal
REM Maximize reports form
DoCmd.Maximize
End Sub
MODULE (this module is the same as close reports except for the DoCmd line)
Sub PrintReports()
Dim rpt As Report
' Enumerate Open Reports in collection.
For Each rpt In Reports
DoCmd.PrintOut (acPrintAll)
Next rpt
End Sub
Any help or suggestions would be greatly appreciated.
Janet Lyn