Print Selected Reports

WineSnob

Not Bright but TENACIOUS
Local time
Today, 08:26
Joined
Aug 9, 2010
Messages
211
I have a table [tblReportList] that lists all the reports. Each report (record) also has a checkbox (Print).
I have a form that lists the reports and shows the check box.
What I would like to do is have the user select the reports they want to print by checking the print checkbox. Then hit a button [Print Selected Reports].
Do I need to have code for each report with an if statement or can code look at each record and if checkbox print=true then docmd.printout?
I am not sure which way to approach this problem.
Thanks.
 
I'd probably open a recordset on an SQL statement that pulled all records with True and print those.
 
What would be the syntax to Print the records?

Code:
Private Sub btnPrintSelected_Click()
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("SELECT tblReportList.Report, tblReportList.Print FROM tblReportList WHERE tblReportList.Print=True")

End Sub
 
Along the lines of

DoCmd.OpenReport rst!Report

within a loop of the records returned.
 
Thanks AGAIN Paul,
Here it is for the next one with the same question.
Code:
Private Sub btnPrintSelected_Click()
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("SELECT tblReportList.Report, tblReportList.Print FROM tblReportList WHERE tblReportList.Print=True")
Do While Not rst.EOF
DoCmd.OpenReport rst!Report
rst.MoveNext
Loop
End Sub
 
Happy to help...send Cabernet!! :p
 

Users who are viewing this thread

Back
Top Bottom