Multiple Reports

  • Thread starter Thread starter James
  • Start date Start date
J

James

Hi

I have a form (frmResignDataCustom) that has six potential
reports to print from the information it contains. I have
set up a command button for the user to click and all six
reports will print consecutively.

What I would like to do is enable the user to select which
reports they would like to print with check boxes and then
hit a "print button". Currently I have set up a form
(frmCustomPrint) with six check boxes and print/cancel
command buttons. The idea is that this form
(frmCustomPrint) will open when the "frmResignDataCustom"
print button is clicked and the user can "check" any of
the required reports and hit the print button on the user
form - thus only printing required reports.

I thought I could do this with an IIF statement based on
the unbound toggle boxes but I am making no progress.

Please is this possible? Any help/suggestions would be
greatly appreciated.

Thanks in advance.

James
 
James,

The code behind the Print command button should look something like:

Private Sub CmdPrint_Click()
Dim ArrReports(5,1) As String
Dim i as Integer
'put the actual report and checkbox names next
ArrReports(0,0) = "ReportName1"
ArrReports(1,0) = "ReportName2"
ArrReports(2,0) = "ReportName3"
ArrReports(3,0) = "ReportName4"
ArrReports(4,0) = "ReportName5"
ArrReports(5,0) = "ReportName6"
ArrReports(0,1) = "CheckBox1"
ArrReports(1,1) = "CheckBox2"
ArrReports(2,1) = "CheckBox3"
ArrReports(3,1) = "CheckBox4"
ArrReports(4,1) = "CheckBox5"
ArrReports(5,1) = "CheckBox6"

For i = 0 to 5
If Me.Controls(ArrReports(i,1)) = True Then
DoCmd.OpenReport ArrReports(i,0), acViewNormal
End If
Next i

End Sub

HTH,
Nikos
 
Back
Top