tech on the net
Home About Us Feedback Site Map


Access Excel Word


SQL Oracle / PLSQL SQL Server MySQL MariaDB PostgreSQL

Web Development

HTML CSS Color Picker


C Language


ASCII Table Linux UNIX Java Clipart Joke of the Moment
Share this page:

MS Access: Set the background color of a button in Access 2003/XP/2000/97

See solution in other versions of Access:

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.