Print Multiple Reports

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

I want to print multiple reports from a table, it can be 0 Reports or 5,
10 or whatever. The table includes...

Report Number Report Name
1 rptCashOut
3 rptServers
2 rptErrors

etc.

How would I code this on a command button?

Thanks
DS
 
Dim rst As Recordset
Dim strReportName As String

Set rst = CurrentDb.OpenRecordset("tblReports")
With rst
.MoveLast
.MoveFirst
If RecordCount > 0 Then
Do While Not .EOF
strReportName = ![Report Name]
Docmd.OpenReport strReportName
.MoveNext
Loop
.Close
End If
End With

Set rst = Nothing
 
Klatuu said:
Dim rst As Recordset
Dim strReportName As String

Set rst = CurrentDb.OpenRecordset("tblReports")
With rst
.MoveLast
.MoveFirst
If RecordCount > 0 Then
Do While Not .EOF
strReportName = ![Report Name]
Docmd.OpenReport strReportName
.MoveNext
Loop
.Close
End If
End With

Set rst = Nothing
Great Thanks Klatuu!
I'll give it a try now.
DS
 
Back
Top