shade

S

supernova

Hi,

I want to recreate a textbox in a report which bind to a table
field and want the textbox to be shaded or background darker colour when a
table field value is matched. How can I set write the code or which
attribute I can use? Thanks.
 
M

Michel Walsh

Hi,


Add a second text control, exactly the same size and the same font and
the same control source than the one to be shaded, but behind the control
being shades (z-order), and a little bit offset down and to the right. Use
the appropriate foreground color, that will be the color of the shadow. Turn
that extra control visibility to true, or false, appropriately, in the
onFormat event:


Me.ExtraControl.Visible = criteriaHere


Hoping it may help,
Vanderghast, Access MVP
 
T

TC

Or, locate the second text control well away from the first one, so you can
easily select either control, when you are changing the form. Then have the
form's Open or Load event move the second control exactly over the first
one, at runtime, when the form opens:

with me![txt2]
.left = me![txt1].left
' ditto .top, .height, .width
end with

This also means tht you do have to be sure, that the second control is
exactly the same size as the first one. The code above will do that for you,
at run time.

HTH,
TC
 
T

Tom B. Cruise

Thanks for the advice. Just wonder if there is a way I can just set up the
background color of a control with some coding condition.
 
T

TC

See the BackStyle & BackColor properties (or somesuch: I don't have Access
here to check the names).

HTH,
TC
 

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