Toggle Question

  • Thread starter Thread starter Pakmanoncrack
  • Start date Start date
P

Pakmanoncrack

Hi,
This is kind of pointless, but I was told to add this to my
database. I have a toggle button to represent certain approvals on a
form. Everything works fine, but my supervisor wants it to be green
when true and red when false. Seems simple, right? Well I cannot seem
to figure out how to do it. I tried setting the picture property when
clicked, which would have worked if there were one record, but the
change in picture resulted in all the corresponding toggle buttons on
the different records changing to the same color, regardless of their
boolean value. Is there a way I can set this up or a different data
type I could use. I want to stay away from coding a picture object
because they do not have control sources, so the code to start them
with correct values would be unpleasant.
Thanks
 
This is kind of pointless, but I was told to add this to my
database. I have a toggle button to represent certain approvals on a
form. Everything works fine, but my supervisor wants it to be green
when true and red when false. Seems simple, right? Well I cannot seem
to figure out how to do it. I tried setting the picture property when
clicked, which would have worked if there were one record, but the
change in picture resulted in all the corresponding toggle buttons on
the different records changing to the same color, regardless of their
boolean value. Is there a way I can set this up or a different data
type I could use. I want to stay away from coding a picture object
because they do not have control sources, so the code to start them
with correct values would be unpleasant.


Change the check box to a small text box. Use the X
character (or use a font such as WingDings that contains a
check mark). Set the text box's Format property to:
"";"X";""

You can then use Conditional Formatting (Format menu) to set
the text box's Backcolor property based on the text box's
value.
 
You said toggle button, but you are describing a command button. Toggle
buttons reside within a option group, command buttons are a different animal.
If you are using a true option group with two toggle buttons, then you can
set the backcolor property of the option group. If you are using a command
button, you cannot easily change it's color. I know there is some code for
doing such a thing using images out there, but the easy way would be to
change the forecolor which would give you read or green text.
 
Toggle button? I didn't read the part about it being a
button??

Regardless, changing the foreground color is a good idea.
Short of the API kind of glop, the only other idea I've used
is to fake the toggle buttons using label or text box
controls along with come code to manage the values.
 
Back
Top