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

Same report printed twice with different footer info

Status
Not open for further replies.

mikelev

Technical User
Mar 23, 2004
223
US
I have read through many threads here looking for a solution, and have not seen any clear cut answers (maybe I missed it?)

I have a report that needs to be priinted twice (sometimes 3 times) with the appropriate department name in the footer.

I can get the report to print multiple copies by repeating the DoCmd.OpenReport "rptStrapVariance", acNormal command.


Any simple way to get individual department names at the bottom of each copy? (i.e 'Accounting', 'Cage')

Im learning fast....please be patient and explicit.


Cheers,
 
Create a new Module and paste the following text:

Public FooterText as String

Public Sub MultiReport_Print()
'Substitute "Report1" with the name of the actual report
FooterText = "Accounting"
DoCmd.OpenReport "Report1", acNormal
FooterText = "Cage"
DoCmd.OpenReport "Report1", acNormal
End Sub

Save the Module (as MultiModule, for example)


Open the report in design view. In the report's Code Module, paste the following text:

Private Sub PageFooter_Format(Cancel As Integer, FormatCount As Integer)
'Substitute FooterField with the actual name of the field where the text is to be place. This field should be unbound.

Me.FooterField = FooterText
End Sub


Save the report. See if this works for you.
 
Another method might be to create a table of Departments and add it to the report's record source. Don't create any join lines. Use criteria to limit the records displayed in the query to just the needed departments.
Set the first Sorting and Grouping Level to the Department field. You can then print the report with as many copies as you like (departments). This doesn't work quite as well if you need page of pages.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top