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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing multiple access reports 1

Status
Not open for further replies.

skyline16

Technical User
Jan 16, 2007
22
US
I have successfully used VBA code to print two different reports at one time. Sometimes, however, both reports are not applicable to the field chosen and I end up just printing blank reports. Is there a way to automatically cancel the printing of a report if no records exists for a particular chosen field?
 
There is a On No Data event of a report that you can use to cancel the printing of your report.
Code:
Private Sub Report_NoData(Cancel As Integer)
    Cancel = True
End Sub
The code that calls the OpenReport method must trap for and ignore error number 2501.


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
This is somewhat similar: I have 4 reports that need to be combined into one report and page numbered as one report. Each report has several subreports in them. Due to the number of subreports and formatting issues, I cannot dump the 4 reports into 1 report. I am using a form to select which data to base the reports on. Looking form some code that i can modify so that I can open the 4 rpoerts in a specific order and then print them with continous page numbering. Access 20003.
 
I don't think your question is similar. For the best chance of getting an answer consider starting a new thread with a subject line like "Numbering Pages across multiple reports".

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top