If you initialize the variable in Report_Open, it will increment with each
time you go through the report. So if you open it in preview, and then
print, it will have the wrong value.
Here's a solution that requires no code, and can't go wrong.
A simple workaround it to create a table containing the names you want on
your report. A table with just 2 fields:
PrintTextID Number
PrintText Text
Enter 2 records:
1 Original
2 Copy
Create a query for the report, and add this table as well as your original
table. (If you already have a query, just add the new one to it.) It is
important that there is no line joining the 2 tables in query design view.
Save the query.
Now open the report in design view.
Make sure its RecordSource is the query you just saved.
In the Sorting'n'Grouping box (View menu), insert a row at the top
Put the PrintTextID field in that row of the dialog.
In the lower pane, choose Yes beside Group Header.
In the new group header, add a text box for PrintText.
The query now feeds 2 copies of the record to the report, and the header now
prints Original or Copy on the 2 copies.
If you do want to print just the original or just the copies, you can add
criteria to the query, or use the WhereCondition of OpenReport.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Hi; Wondering if anyone can solve this problem, which worked fine in Ac2
> and
[quoted text clipped - 39 lines]
> Any suggestions for correction are needed.
> Richard
atlantis43 - 30 Jul 2006 14:40 GMT
Allen; thanks for response. I've noted similar 'solution' descriptions for
this problem in monster, but I'm not sure that they are not more complicated
than simple for my problem. Though I might try & see, I'm hesitant because:
1)my reports (invoices) are obligatorily in many different formats (for
medical insurance billing), and the recordsources are variable-order
subqueries constructed on the fly. Adding another level of decision
construction seem like it might further complicate the logic.
2)While some forms REQUIRE several non-identical copies (2 or 3), others only
need them in certain circumstances, further confusing the programmer.
">If you initialize the variable in Report_Open, it will increment with each
>time you go through the report. So if you open it in preview, and then
>print, it will have the wrong value."
Is there any way to compensate for this in code, so that I don't have to
change the logical construction of what worked so well in Ac2?
Thanks, richard
>If you initialize the variable in Report_Open, it will increment with each
>time you go through the report. So if you open it in preview, and then
[quoted text clipped - 33 lines]
>> Any suggestions for correction are needed.
>> Richard
tina - 30 Jul 2006 20:26 GMT
you might try moving the label control, (and the page numbers control) to
the Page Footer section of the report, then run your code in the
PageFooterSection_Format event procedure.
hth
> Allen; thanks for response. I've noted similar 'solution' descriptions for
> this problem in monster, but I'm not sure that they are not more complicated
[quoted text clipped - 51 lines]
> >> Any suggestions for correction are needed.
> >> Richard
atlantis43 - 30 Jul 2006 22:43 GMT
unfortuneately, the layout of the form doesn't allow any room BELOW the
detail section, so I'm unable to use that section even if the coding would
work (but for curiosity's sake I might just try it.
Richard
>you might try moving the label control, (and the page numbers control) to
>the Page Footer section of the report, then run your code in the
[quoted text clipped - 7 lines]
>> >> Any suggestions for correction are needed.
>> >> Richard
david@epsomdotcomdotau - 31 Jul 2006 00:13 GMT
What is the behaviour you see?
The code that you provided is obviously incorrect, what is the code
that you use?
(david)
> Allen; thanks for response. I've noted similar 'solution' descriptions for
> this problem in monster, but I'm not sure that they are not more complicated
[quoted text clipped - 51 lines]
> >> Any suggestions for correction are needed.
> >> Richard
Allen Browne - 31 Jul 2006 01:51 GMT
If you are creating the RecordSource string (SQL statement) in Report_Open,
it is simply a matter of:
- adding the PrintText table to the FROM clause without a join for those
cases where you want both, and
- assigning the PrintText field as ControlSource of the (otherwise unbound)
textbox.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Allen; thanks for response. I've noted similar 'solution' descriptions
> for
[quoted text clipped - 57 lines]
>>> Any suggestions for correction are needed.
>>> Richard
atlantis43 - 01 Aug 2006 03:46 GMT
Allen;
Tried the cartesian implementation, and it works just fine! My only problem
is that, with all of the different invoice forms that I have, all with
different stringSQL recordsources, I have hours of work involved in setting
up the necessary changes. I
Since my report only has room for a detail section, I found that I can move
my lblCopy (now TxtCopy) onto my detail section with no ill effects, and
shrink the countid group header field to height=0. Everything now fits.
Thanks again
Richard
>If you initialize the variable in Report_Open, it will increment with each
>time you go through the report. So if you open it in preview, and then
[quoted text clipped - 33 lines]
>> Any suggestions for correction are needed.
>> Richard