How create shaded box behind control ?

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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.
 
Wont that shade the entire detail section? That's not what I want. I need to
shade or unshade boxes surrounding individual controls.
 
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.
 
Back
Top