Full Version: Different footers in different copies of the same page.
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
bijondhanbad
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
strive4peace
Hi Bijon

make a global variable with module level scope (dimension it at top of the module before any procedures) and a Sub and a Function in a general module:

CODE

dim gCopyNo as integer

Sub InitializeCopyNo()
   gCopyNo  = 0
end function

function GetCopyNo() as Integer
   gCopyNo  = gCopyNo  + 1
   GetCopyNo = gCopyNo
   if gCopyNo  = 3 then gCopyNo  = 0
end function


before you send three copies of the report to render,

CODE
   InitializeCopyNo


on the report, make a combobox where you want the information to print

Name --> ReportCopyNo
Controlsource -->
RowsourceType --> Value List
RowSource --> 1; Customer Copy; 2; Seller Copy; 3; Office Copy
columncount --> 2
ColumnWidths --> 0;1

in the Format event of the Report header section:

CODE
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
   If FormatCount = 1 Then me.ReportCopyNo =GetCopyNo()
End Sub
bijondhanbad
Thanks Crystal..

but it doesn't work out.

With regards,
Bijon
strive4peace
Hi Bijon,

post your database and specify the report to look at as well as the form you are using to launch the report
bijondhanbad
Hi Crystal!

Attaching a part of my database.

You can use the rptSalesInvoice to open the report. Put a challan no as 003 & try out. The invoice can be previewed. Now I want three copies of the same page one with footer Customer copy 1, the other with Customer Copy 2 as footer and the last as Office Copy as footer.

Please help.

With regards
Bijon
strive4peace
Hi Bijon,

I am looking at your database... where is the code I gave you? Did you set up a form to process the request? Did you make a general module? I do not see them...

this may help your understanding...

Access Basics
http://www.utteraccess.com/forums/showflat...;Number=1220772
30-page Word document on Access Basics (for Programming) -- it doesn't cover VBA, but prepares you for it because it covers essentials in Access
bijondhanbad
Still not able to figure it out. Can someone help?

Bijon
strive4peace
Hi Bijon,

after I gave you a solution, you said, "but it doesn't work out."

so I asked for your database to see why -- and there are no traces of you even trying it! If you wanted more explanation, you just needed to ask, not make it seem like it didn't work when you didn't even try!
bijondhanbad
Someone please help me out.
strive4peace
Hi Bijon,

this solution assumes you will send the report 3 times ... not specify 3 copies of the same report.

There are other ways to do this -- maybe someone else can offer some different advice.
truittb
Crystal offered you a perfectly good solution. You need to implement it and then explain in detail why it is not working in your case. We can't help you if you don't try to help yourself. Just saying "but it doesn't work out" does not suffice.
breauxlg
The solution worked fine, except that you put an end function instead of an end sub on the initialize sub. Thanks, Lynn
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.