Change appearance of Command Button or Label on Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a Form with Command Buttons that execute other Forms to run
procedures, reports etc. I want the appearance of the button to change
after they have executed the button. Thanks, Claire
 
A command button in MS Access does not have a back color property.

You could simulate a command button by using a textbox which you can change
the back colour or style on. If you want it to appear as the normal colour
first, the standard back colour is -2147483633 (Change border style to suit
etc). You can then set your code in the on click event which changes the back
colour and performs the task you require.

HTH Mike

--
An Engineers Prayer:
At the very end of the day,
when all else fails,
you have tried all
and asked everyone you know,
read the instruction manual.
 
nicknameClair said:
I have created a Form with Command Buttons that execute other Forms to run
procedures, reports etc. I want the appearance of the button to change
after they have executed the button. Thanks, Claire

If, after using a button, you don't want it used again, you could set its
Enabled property to False, and that would "grey it out". If you only want
to change the appearance, you can change the ForeColor -- the color of the
Text.

Add code similar to the following to the Click event -- this works on a
command button named "cmdToggleColor" to switch between black and red text.


If Me.cmdToggleColor.ForeColor <> 255 Then
Me.cmdToggleColor.ForeColor = 255
Else
Me.cmdToggleColor.ForeColor = -2147483630
End If

Larry Linson
Microsoft Access MVP
 

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

Back
Top