totn Access

MS Access 2003: Set the background color of a button

This MSAccess tutorial explains how to set the background color of a button in Access 2003 (with screenshots and step-by-step instructions).

Question: In Microsoft Access 2003/XP/2000/97, how do I set the background color of a command button?

Answer: Unfortunately, you can't change the back color of a command button. As an alternative, you could create a label and have it behave as a button.

To do this, create a label. Right-click on the label and view its properties.

Set the Back Color property of the label to the color that you want. Then set the Special Effect property to Raised.

Then code it's Mouse Down event to:

[LabelName].SpecialEffect = 2

Code the Mouse Up event:

[LabelName].SpecialEffect = 1

Code the OnClick event as if it was a command button.

Center the label text horizontally using the text alignment tool button or setting the Text Align property to Center.

If you want to align text vertically, Press Shift+Enter then type in the label text.

It will look and act like a command button.