3 part form using plain paper

G

Gary.

I am setting up at Access 2007 report as a 3 part form using plain paper.

What I think I need to do is have the printer print 3 copies I need a color
box on the report to change color depending on which copy is printing

Example I send the report to the printer to print 3 copies.
The color box on the first copy would be white, the color of the box on the
second copy would be yellow and the color on the 3rd copy would be pink
Is their a way to do this in VBA?
 
A

Allen Browne

Create a table with these fields:
CopyID Number primary key
CopyColor Number

Enter 3 records, like this:
1 16777215
2 65535
3 12632319

Create a query using your existing table(s) and also the new one. There must
be no line joining the new one to your existing table. This will give you 3
copies of every record.

In the report, add a text box to show the color you want, and use
Conditional Formatting to set its color based on the CopyID. Alternatively,
use a rectangle, and place code in the Format event of the section to set
its BackColor property to the CopyColor value.
 
M

Marshall Barton

Gary. said:
I am setting up at Access 2007 report as a 3 part form using plain paper.

What I think I need to do is have the printer print 3 copies I need a color
box on the report to change color depending on which copy is printing

Example I send the report to the printer to print 3 copies.
The color box on the first copy would be white, the color of the box on the
second copy would be yellow and the color on the 3rd copy would be pink
Is their a way to do this in VBA?


If you want the same report printed three times, try using a
utility table. Create a table (named Numbers) with one
field (named Num) and populated with the values 1, 2, ...,
99

Then change your report's record source query to look
something like:

SELECT yourtable.*, Numbers.Num
FROM yourtable, Numbers
WHERE Numbers.Num <= 3 AND (your criteria)

Then change the report by adding a new top level gtoup on
the Num field. Set the group header section's ForceNewPage
property to Before Section. If you are currently using the
report header and footer sections move that stuff to the new
group's header and footer sections. Add a line of code to
the new group header's Format event to ewset the page
number:
Me.Page = 1

If desired, you can add a text box (anywhere you like) with
an expression like
="Copy " & Num
If you don't need something like that, you still need a
(hidden?) text box that uses the Num field.

You can get the color you want by using some code in the
Format or Print event of the section that contains the color
box:

Select Case Me.Num
Case 1
Me.colorbox.BackColor = vbWhite
Case 2
Me.colorbox.BackColor = RGB(255,255,128) 'pale yellow
Case 3
Me.colorbox.BackColor = RGB(255,220,220) 'pink
Case Else
Me.colorbox.BackColor = vbRed
End Select
 

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