Customized Multiple Copy Reports

O

One complete fool

I am creating a database to keep track of Purchase Orders.

I would like the report to print out 4 copes slightly different

1 Marked "Accouning Copy"
2 Marked "Department Copy"
3 Marked "Requestor Copy"
4 Marked "Vendor Copy"

Is there a way to do this? I have had no luck trying to figure it
out.

Thank you
 
G

Gina Whipp

Found this:

Another simple solution to produce multiple copies is to create a table
(tblPrintCopies) with a single integer field. Add one record for each copy
required (1,2,3,4,5 etc). Add this table to the recordsource of the report
with no joins to any other table. When the recordsource query is run,
because a relationship between tblPrintCopies and the other table(s) cannot
be established the query will produce a line for each entry in
tblPrintCopies. So if tblPrintCopies contains 5 records, the recordsource
will produce 5 records for each "true" record in your other tables, as such
when printed, the report will generate 5 copies.

If you want to actually show a copy description in your report , instead of
using integers in tblPrintCopies use a text field and enter records for
"Original", "File Copy", "Customer Copy" etc. Drag this field into the
recordsource and bind a control on your report to this field. When printed
each
copy will be identical except for the copy description field.


Wayne Gillespie
Gosford NSW Australia

Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II
 
K

krissco

I am creating a database to keep track of Purchase Orders.

I would like the report to print out 4 copes slightly different

1 Marked "Accouning Copy"
2 Marked "Department Copy"
3 Marked "Requestor Copy"
4 Marked "Vendor Copy"

Is there a way to do this? I have had no luck trying to figure it
out.

Thank you

Use Gina's solution. Just for the sake of it, I'll type a different
way.

You could open and print the report four times with code like this:

public sub PrintFourCopies(strReportName as String)
DoCmd.OpenReport strreportname, acViewNormal, , "1=1"
DoCmd.OpenReport strreportname, acViewNormal, , "2=2"
DoCmd.OpenReport strreportname, acViewNormal, , "3=3"
DoCmd.OpenReport strreportname, acViewNormal, , "4=4"
end sub

Here we pass the report a "bogus" filter string. Now we want to use
the filter string in the report's events to change the caption/header
of the report. You can place the following code in many places: In the
report header OnFormat for instance, or (I believe) in the report's
OnActivate or OnLoad events.

public sub PutThisCodeInSomeEvent()

if me.filter <> "" then
select case val(left(me.filter, 1))
case 1
me.someLabelOnYourReport.Caption = "Accounting Copy"
case 2
me.someLabelOnYourReport.Caption = "Foo Copy"
case 3
me.someLabelOnYourReport.Caption = "Bar Copy"
case 4
me.someLabelOnYourReport.Caption = "Zot Copy"
end select
end if
end sub

Ok. So that's a complicated way of passing the header to a report. If
you want the title in a text box instead of a label, instead of
"me.someLabelOnYourReport.Caption =" use
"me.someTextBoxOnYourReport.Value = "=""Accounting Copy"""" - remove
the outer quotations. Sorry if that gets confusing.


Other ways to do this: Bind a control on your report to a text box on
a form and let the user specify their own title. . .

Lots of ways. Use Gina's though.

-Kris
 
G

Gina Whipp

Krissco,

Your way, if I change the name of the 'copy', I have to get to the code. My
way, I can change it in the table. NOT trying to start an arguement just
wondering why you do it that way.
 
K

krissco

Krissco,

Your way, if I change the name of the 'copy', I have to get to the code. My
way, I can change it in the table. NOT trying to start an arguement just
wondering why you do it that way.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

The only reason I would ever do it my way instead of yours is to save
yourself creating one more table. This need for multiple copies could
(not likely) be needed on multiple reports where the header/title is
always different. In this extreme case, you would end up with a table
for each report.

Now that I think of it, only one table and a funky query would be
necessary:

Table dual (borrowing from Oracle) has one record with a bogus value.

Select "Accounting Copy" as myTitle
from dual
union
Select "Another Copy"
from dual
union
Select "Yet Another Copy"
from dual . . . . .

Save this as a view and base the report on the Cartesian product
between it and the normal record source of the report.
Now we only have one table - no matter how many crazy reports, and a
bunch of crazy queries!!

But seriously - is this any better?

-Kris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top