'Why I cant change the BackColor of a CommandButton in VBA?

In access-VBA I want to change the background color of a CommandButton called "schmultiform"

So I tried to change it in the properties-window with no effect. The background stays in light grey whatever value i put into BackColor.

Then I used the following code in Form_open

Me.schmultiform.BackStyle = 1
Me.schmultiform.BackColor = RGB(255, 0, 0)

but it had no effect.

I created a new access-file, made a dummy form and put a button there. The background of this button I can change as I want. When I copy&paste the dummy-form from the test-db into my original db, the button behaves like the other one before: Its background-color switches to lightgrey and its not changable anymore.

So I supposed the problem is in the database. Maybe there is some kind of default-style or something else but I couldnt find anything.

Any suggestions?

Update:

I found out that there are differences in the properties of the dummy button in the test database and the original button: A property "Use Theme" is available in my test-database but it is missing in the properties window of the original button in my original database.

Changing "Options menu >> Current Database >> Use Windows-themed controls on forms." to true will change the style of my buttons but its still not possible to change the backgroundcolor of buttons.

The creation of the original database was several years (maybe >15?) ago.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source