Report format question

M

mikejs2000

Hi,
A few years back I picked up a small bit of code that let me format a report
with each consecutive line a different colour eg line 1 white line 2 yellow
line 3 white line 4 yellow. to make the report easier to read. I have since
found that the cd containing the database that had this is now un-readable. I
was wondering is anyone could direct me to the said code, I can remember it
used a little known command.
Thanks for yout time

Mike J. Soames
 
A

Allen Browne

If this is Access 2000 or later, there is now an easier, more efficient
solution that uses no code.

1.Open the report in design view.

2. Place a Text box in the Detail section of your report, and set these
properties:
Control Source =1
Running Sum Over Group
Format General Number
Visible No
Name txtCount

3. Add another text box. Size it so if fills the whole Detail section.

4. Place it behind the other boxes (Format | Send To Back.)

5. With this box selected, choose Conditional Formatting on the Format menu.
Set Condition 1 to:
Expression [txtCount] Mod 2 = 0
and set the color your want for the alternating rows.

This box will now change color every second row. You may need to set the
BackStyle of the other boxes in the Detail section to Transparent.
 
M

mikejs2000

Thanks Allen,

Its now alot simpler than I remember.

Mike J. Soames

Allen Browne said:
If this is Access 2000 or later, there is now an easier, more efficient
solution that uses no code.

1.Open the report in design view.

2. Place a Text box in the Detail section of your report, and set these
properties:
Control Source =1
Running Sum Over Group
Format General Number
Visible No
Name txtCount

3. Add another text box. Size it so if fills the whole Detail section.

4. Place it behind the other boxes (Format | Send To Back.)

5. With this box selected, choose Conditional Formatting on the Format menu.
Set Condition 1 to:
Expression [txtCount] Mod 2 = 0
and set the color your want for the alternating rows.

This box will now change color every second row. You may need to set the
BackStyle of the other boxes in the Detail section to Transparent.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

mikejs2000 said:
A few years back I picked up a small bit of code that let me format a
report
with each consecutive line a different colour eg line 1 white line 2
yellow
line 3 white line 4 yellow. to make the report easier to read. I have
since
found that the cd containing the database that had this is now
un-readable. I
was wondering is anyone could direct me to the said code, I can remember
it
used a little known command.
Thanks for yout time

Mike J. Soames
 

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