How create shaded box behind control ?

G

Guest

A user wants a report that looks like a checkerboard. Each square can
contain one of two dates TARGET or ACTUAL. If the date is a target the box is
to be unshaded and if its an actual the box is to be shaded. Is there any way
to do this in an Access (2003) report? The shaded area needs to fill the
entire height of each detail row which can very in height, so it needs to
shrink and/or grow.
 
M

Marshall Barton

mscertified said:
A user wants a report that looks like a checkerboard. Each square can
contain one of two dates TARGET or ACTUAL. If the date is a target the box is
to be unshaded and if its an actual the box is to be shaded. Is there any way
to do this in an Access (2003) report? The shaded area needs to fill the
entire height of each detail row which can very in height, so it needs to
shrink and/or grow.


Just set the detail section's BackColor property:

If <date is a target> THen
Me.Section(0).BackColor = RGB(192,192,192) 'lt gray
Else
Me.Section(0).BackColor = RGB(255,255,255) 'white
End If

You also need to set each control's BackStyle property to
Transparent.
 
G

Guest

Wont that shade the entire detail section? That's not what I want. I need to
shade or unshade boxes surrounding individual controls.
 
M

Marshall Barton

I guess I don't quite know what you mean by "square/boxes
around" the controls. If they're Rectangle controls, then
just use the detail section Format event to set the box's
BackColor property instead of the section's:

Me.Box10.BackColor = RGB(192,192,192) 'lt gray

That's such a simple answer that I still have the feeling
that I am not grasping what you are trying to describe.
 

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