Complexity of report

IgorB

Registered User.
Local time
Today, 05:36
Joined
Jun 4, 2003
Messages
183
Is this possible to print the same report 3 times(produce 3 copies) with

1st copy has label "1st copy"
2nd copy has label "2nd copy"
3rd copy has label "3rd copy"

When user click the button "Print" it should print 3 copies with 3 different label values.

Thanks.
 
I suppose you could create three copies of the report and change the label in each one. Behind the the print button, write three lines of code for each separate report.

Regards.
 
Use an unbound caption on your report and then use a loop to cycle through 3 times - printing each time in addition to changing the name of the caption on the report to "1st copy", "second copy" etc...

HTH,
Kev
 
Use loop where in report open, don't think it will work.
When I OPEN report from screen it does not understand reference to report name.

Give me more explanation how?
 
Igor -

I don't have time to put together a sample right now as I'm going into a meeting in about 5 minutes but I'll put something together for ya later if your still having trouble...

Put an unbound field on your form and call it txtReportHidden. Make the field invisible. On the report itself put a new field on the report and call it txtCopyNum. Make the control source for this field "=forms!yourformname!txtReportHidden" Now on the code behind your button put something like this:

Code:
dim i as integer
i = 1
do Until i > 3
  If i = 1 then
    me.txtReportHidden = "1st Copy"
  ElseIf i = 2 then
    me.txtReportHidden = "2nd Copy"
  ElseIf i = 3 then
    me.txtReportHidden = "3rd Copy"
  end if
docmd.openreport "Your Report Name", acViewNormal
i = i + 1
Loop
end sub

Something like this should do the trick but may require a bit of tweaking as I don't have a lot of time to tinker with this right now... give it a shot and post back if you need more help...

HTH,
Kev
 
Kevin,
Thanks for an example. I tested and it works just fine.
The only thing I do not understand when I change acViewNormal to preview mode MS Access previewed report with "1st copy" and not other 2 reports(i.e. i=2 and i=3).

Igor.
 
Igor -

The cause for this (I believe) is that when in preview mode Access will only open one report in preview at a time so, basically, the first opened previewed report breaks the loop as it waits for your input on what to do...

sorry if this is what you wanted in the first place but you said you were trying to print three reports not preview three reports! :D

If you want to preview instead you'll have to find a different code/way to do this...

*** Also - I was hasty in trying to post this for you yesterday as I was going into a meeting at the time but you may be able to clean this code up a bit by using the OpenArgs property of the OpenReport command to add the caption variable to the report instead of using a textbox on the form... may want to experiment with this...

HTH,
Kev
 
Thanks a lot, Kevin
Printing 3 reports is still good for me.
I did not respond 1,5 weeks; vacation time.
Igor.
 

Users who are viewing this thread

Back
Top Bottom