By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,153 Members | 2,581 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,153 IT Pros & Developers. It's quick & easy.

Different footers in reports

P: 8
I want to have different footers in different copies of the same page. Like while printing an invoice, I want CUSTOMER COPY on one copy, SELLER COPY on the second copy, OFFICE COPY on the third copy of the invoice.

How do I do it?
Will someone help..

Regards,
Bijon
Aug 12 '07 #1
Share this Question
Share on Google+
8 Replies


Rabbit
Expert Mod 10K+
P: 12,383
I want to have different footers in different copies of the same page. Like while printing an invoice, I want CUSTOMER COPY on one copy, SELLER COPY on the second copy, OFFICE COPY on the third copy of the invoice.

How do I do it?
Will someone help..

Regards,
Bijon
Make 3 copies of the report and use them as sub reports in a larger report.
Aug 12 '07 #2

puppydogbuddy
Expert 100+
P: 1,923
Make 3 copies of the report and use them as sub reports in a larger report.
Another alternative:

Create the multiple prints in code with a For/Next Loop. Use an unbound textbox named txtReportTitle with its “can grow” property set to yes to change Title for each copy. Replace "YourFormReport" with the actual name of your report.

Expand|Select|Wrap|Line Numbers
  1. Private Sub btnInvoicePrint_Click()
  2.  
  3. Dim x as Integer                   ‘loop counter
  4.  
  5. For x = 1 to 3
  6.     If x = 1 then
  7.         txtReportTitle.Value = “Customer Copy”
  8.     ElseIf x = 2 then
  9.         txtReportTitle.Value = “Seller Copy”
  10.     ElseIf x = 3 Then
  11.         txtReportTitle.Value = “Office Copy”
  12.     Else
  13.         Exit Sub
  14.     End If
  15.     DoCmd.OpenReport “yourFormReport”, acViewNormal
  16. Next x
  17.  
  18. End Sub
Aug 12 '07 #3

P: 8
Tried this out.
Everytime it is giving an error--- Object required.
On debugging, it points to the line : txtReportTitle.Value = “Customer Copy”

Please help
regards
bijon

Another alternative:

Create the multiple prints in code with a For/Next Loop. Use an unbound textbox named txtReportTitle with its “can grow” property set to yes to change Title for each copy. Replace "YourFormReport" with the actual name of your report.

Expand|Select|Wrap|Line Numbers
  1. Private Sub btnInvoicePrint_Click()
  2.  
  3. Dim x as Integer                   ‘loop counter
  4.  
  5. For x = 1 to 3
  6.     If x = 1 then
  7.         txtReportTitle.Value = “Customer Copy”
  8.     ElseIf x = 2 then
  9.         txtReportTitle.Value = “Seller Copy”
  10.     ElseIf x = 3 Then
  11.         txtReportTitle.Value = “Office Copy”
  12.     Else
  13.         Exit Sub
  14.     End If
  15.     DoCmd.OpenReport “yourFormReport”, acViewNormal
  16. Next x
  17.  
  18. End Sub
Aug 13 '07 #4

puppydogbuddy
Expert 100+
P: 1,923
Tried this out.
Everytime it is giving an error--- Object required.
On debugging, it points to the line : txtReportTitle.Value = “Customer Copy”

Please help
regards
bijon
Did you go into design view and add an unbound textbox, and set its name property to txtReportTitle?

If you did the above and it is not working, let me know.
Aug 13 '07 #5

P: 8
Added an unbound textbox in the Report footer section with that name.Set the CanGrow property to yes and tried it out.
Doesn't work.
Please help.
bijon

Did you go into design view and add an unbound textbox, and set its name property to txtReportTitle?

If you did the above and it is not working, let me know.
Aug 14 '07 #6

puppydogbuddy
Expert 100+
P: 1,923
Added an unbound textbox in the Report footer section with that name.Set the CanGrow property to yes and tried it out.
Doesn't work.
Please help.
bijon
I think the problem is that the title needs to inserted in the Report's open event, and therefore two event procedures are required...one for the button click to print the report and a separate sub for the insertion of the txtTitle during the report's open event. See the code for the two procedures below.

Expand|Select|Wrap|Line Numbers
  1. Private Sub btnInvoicePrint_Click()
  2. Dim x as Integer                   ‘loop counter
  3.  
  4. For x = 1 to 3
  5.     DoCmd.OpenReport “yourFormReport”, acViewNormal
  6. Next x
  7. End Sub
________________________________________
Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_Open(Cancel As Integer)
  2. Dim x as Integer                   ‘loop counter
  3.  
  4. For x = 1 to 3
  5.     If x = 1 then
  6.         txtReportTitle.Value = “Customer Copy”
  7.     ElseIf x = 2 then
  8.         txtReportTitle.Value = “Seller Copy”
  9.     ElseIf x = 3 Then
  10.         txtReportTitle.Value = “Office Copy”
  11.     Else
  12.         Exit Sub
  13.     End If
  14. Next x
  15.  
  16. End Sub
Aug 14 '07 #7

P: 8
It doesn't work still.
I tried another way. I deleted the second code from the report On Open event and pasted it on the Page footer "On print" event.

This time, however, it is asking for the invoice no on three different occassions but every time the footer comes out as Office Copy and not as desired.

Please try it out

Regards
bijon
Aug 14 '07 #8

puppydogbuddy
Expert 100+
P: 1,923
It doesn't work still.
I tried another way. I deleted the second code from the report On Open event and pasted it on the Page footer "On print" event.

This time, however, it is asking for the invoice no on three different occassions but every time the footer comes out as Office Copy and not as desired.

Please try it out

Regards
bijon
Ok. I tested the following code and it works on Access 2000:
Expand|Select|Wrap|Line Numbers
  1. Private Sub btnInvoicePrint_Click()
  2. Dim x As Integer      'loop counter
  3.  
  4. For x = 1 To 3
  5. Me.Painting = False
  6.   DoCmd.OpenReport "YourInvoiceReport", acViewPreview
  7.     If x = 1 Then
  8.         Reports!YourInvoiceReport!txtReportTitle.Value = "Customer Copy"
  9.     ElseIf x = 2 Then
  10.         Reports!YourInvoiceReport!txtReportTitle.Value = "Seller Copy"
  11.     ElseIf x = 3 Then
  12.         Reports!YourInvoiceReport!txtReportTitle.Value = "Office Copy"
  13.     Else
  14.         Exit Sub
  15.     End If
  16.   DoCmd.OpenReport "YourInvoiceReport", acViewNormal
  17.   DoEvents
  18. Me.Painting = True
  19. Next x
  20.  
  21. End Sub
Aug 14 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.