473,325 Members | 2,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Different footers in reports

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
8 2944
Rabbit
12,516 Expert Mod 8TB
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
1,923 Expert 1GB
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
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
1,923 Expert 1GB
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
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
1,923 Expert 1GB
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
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
1,923 Expert 1GB
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

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

Similar topics

2
by: Rupe | last post by:
Hi CSS gurus! I have an embarassing problem. I am a php programmer and I try to expound the advantages of css on the php newsgroups. However, after telling someone that they should use css...
28
by: reneecccwest | last post by:
hello, how can I remove IE headers and footers when I print a page? I'd like to use a code to remove them, not thru the IE page setup. s/RC
1
by: Kenneth | last post by:
Hi, In IE6 you can configure output to the printer getting a clean printout only with content, but without headers and footers. You remove the Header and Footer content from the Page Setup. But...
7
by: Robert Adkison | last post by:
I need to print a web page. It is my preference that my users just do a File/Print from explorer. That way my users will get the print dialog that will allow them to select the fax printer. The...
1
by: Jim | last post by:
This should be easy, but I have not found much that makes sense. My application creates a document, of indeterminate length, and prints the document. I am printing from a saved document in RTF...
2
by: kaosyeti | last post by:
hey... i have a quarterly report that i'm working on where each of the 12 or so pages is completely different from the other. all are based on basically the same info (ergo, the same query) but...
3
by: TS | last post by:
I have 2 sql server databases on 2 different servers, a web app, and a crystal reports interface. When the app uses 1 database and the reports datasource points to a different database, both...
0
by: deepaks85 | last post by:
I need to create a CMS in which we will create user and each user should connected with the different airlines databases and that user will be able to upload files and view files in PDF and print...
4
by: ppuniversal | last post by:
Hi, I am developing an application in ASP .NET where I have to generate a Header and a Footer on my web pages. The issue is that, these headers and footers need to be dynamically placed on the page....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.