Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to apply theme on converted access 97 form?

I upgraded an access 97 application to access 2010

When I create a new form, there's like a master design that I can apply on every forms with 1 click. This feature doesn't work on my old forms (Nothing change).

enter image description here

I tried to start with a blank database and import everything. Now the forms are a bit better looking cause the button are rounded and the font is better but I still can't change the labels background with the master design.

The color is like hard coded in the properties for every labels. I can select them all and change it but I will have to do it for every forms. Is there a way I can use a master design with my old forms?

Thank you.

like image 733
Marc Avatar asked Nov 16 '25 11:11

Marc


1 Answers

Theme fore colors are applied to labels using the following properties:

ForeThemeColorIndex
ForeTint
ForeShade

As near as I can tell, when you import a form from a different database where themes were not applied, the ForeThemeColorIndex value will be set to -1 for some controls. This basically tells Access that these controls have a color that's "hard coded" (though not in VBA).

I'm thinking the only way to fix this problem is to use VBA to open each form in design view, loop through all of the form's controls, and if the control is a label control (or any other control you're having trouble with), apply your theme colors using the correct theme-related properties. Once you've set the control to use theme colors, changing or applying themes should work without a hitch.

Here's a list of these properties. This is not necessarily comprehensive. I just pulled this using a basic loop looking at properties for a label control. These properties are the same for textbox controls. This list is with theme colors applied successfully to my label control named lblLastName:

lblLastName: BackThemeColorIndex=1
lblLastName: BackTint=100
lblLastName: BackShade=100
lblLastName: BorderThemeColorIndex=0
lblLastName: BorderTint=50
lblLastName: BorderShade=100
lblLastName: ThemeFontIndex=1
lblLastName: ForeThemeColorIndex=0
lblLastName: ForeTint=75
lblLastName: ForeShade=100
lblLastName: GridlineThemeColorIndex=1
lblLastName: GridlineTint=100
lblLastName: GridlineShade=65

Here's a link to some of Microsoft's Documentation on this: http://msdn.microsoft.com/en-us/library/office/ff195247.aspx

like image 109
HK1 Avatar answered Nov 18 '25 19:11

HK1



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!