Traffic Light

G

Guest

Hi everyone!

I really don't know if this question applies to this forum ... but still ...

I have a form with a subform (with a table inside, datasheet coming fro a
query) and I'd ike to generate a 'traffic light' base on some values of the
table. E.g. if compliance is below 70% show a red sign, if higher a green
sign in the form ...

Maybe a text box can change of color, I really don't know... Can anybody help?

Thanks. Bregards

Santiago
 
R

Rick B

You can use conditional formatting to change the color of a control based on
the value in that control (or another control) or based on a formula.
 
G

Guest

There a couple of ways you can do this, but I don't know what version of
Access you are on. If it is 2K or > then you can create a text box and use
conditional formatting. For older versions, you can set the back color of a
text box to do this:

If compliance < .7 then
Me.TrafficLight.BackColor = vbRed
Else
Me.TrafficLight.BackColor = vbGreen
End if

A really cool way, if you can find bitmap images of stop signs with each
light lit up, you could put all 3 images on top of each other on the form,
make them all invisible, and once you have compliance calculated, make the
appropriate image visible.
 

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