Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you print several snapshot reports with one command??

Status
Not open for further replies.

jmcd2000

Programmer
Dec 16, 2003
11
GB
I have several (complicated) reports which are run through a web front end - some of these reports also have subreports.

I have had to use event procedures to get them to work.

Now the client wants a button or similar to print out ALL the reports. Any ideas??

Thanks in advance.
 
Do you need to do this within Access or through your webpage?

Eric
 
Good question!

It would nee to be kicked off through the web page - as all the current reports are.

But instead of just printing one report I want it to print all 20 reports.

I don't want to have one main report full of 20 sub reports so I was hoping for a more subtle approach possible using the OpenReport command??

I guess I still need to call a report which in turn print out all the reports??

Hope you can help!

Janice.
 
I have no idea if this will be of any use to you or not. (I know very little of web design)
You can print multiple reports using visual basic. Mabye you can call a vb function from your webpage.

This will print all reports in a database.

Function PrintAllReports()
Dim strSQL As String
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = CurrentProject.AccessConnection
Set rs = New ADODB.Recordset
strSQL = "SELECT MSysObjects.Name, MSysObjects.Type FROM MSysObjects WHERE (((MSysObjects.Type)=-32764));"
With rs
Set .ActiveConnection = cn
.Source = strSQL
.Open
End With

Do Until rs.EOF
strRpt = rs!NAME
DoCmd.OpenReport strRpt
rs.MoveNext
Loop
End Function

If you need to print selected reports in your DB then you can use a function like this:

Function PrintReports()
DoCmd.OpenReport "YourFirstRpt"
Docmd.OpenReport "YourSecondRpt"
DoCmd.OpenReport "YourThirdRpt"
'etc.
End Function


Eric
 
Thanks for your advice but this won't work - from the webpage it calls Access passing in the name of a report and an ID.

I need code (within a report) that calls each of my individual reports and prints them out to a file with a page break between each report!!

 
Sorry, but it looks like the subreport option is the way you will have to go.

Eric
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top