Changing the color of an Image in a form

bobburg

Registered User.
Local time
Today, 14:36
Joined
Apr 18, 2005
Messages
18
I have a form which uses a query for entry to the table. One of the fields in the query is a calculated field which shows in the form. The calculated field returns a number from 1 to 5. Rather than showing this number I would like to show a round stoplight that changes color for each number. I have inserted a OLE object OLEunbound235 into the form. The colors I want to use are
icolor = RGB(255, 204, 0) 'Gold
icolor = RGB(192, 192, 192) 'Silver
icolor = RGB(216, 129, 0) 'Bronze
icolor = RGB(255, 255, 0) 'Yellow
icolor = RGB(255, 0, 0) 'Red
and icolor = RGB(255, 255, 255) 'White for any other value.

The text box that returns the calculated number is labeled Text1 and I have hidden this box so it can not be seen. Does anyone know how to write this code that would change the OLE object color automatically so when the user enters data into the form and the return number changes the color of the OLE object changes. I know very little about VBA and I am not sure where to begin or where to even write the code.

:confused:
 
You cannot change the color of the OLE object unless you can write some VBA code to actually step into the OLE application to control it from there.

Draw your own "stoplight" - even if it is a bit ugly - using a circle drawing. Access lets you do that all the way back as far as Ac97. You could draw your colors as the background color of the circle that is part of your stoplight.
 
How do you draw in access? Is there a tool bar for this?
 

Users who are viewing this thread

Back
Top Bottom