Solved Changing Color Theme via VBA in Runtime (1 Viewer)

Pac-Man

Active member
Local time
Today, 10:27
Joined
Apr 14, 2020
Messages
408
Glad to be of help.
I am working on some other code to store the theme that was originally used in a database so that it can be replaced if a user picks a theme and then decides is not sensible and want to return to the original after a compact and repair.
I will post that tomorrow or Wednesday.
Thanks a lot. I checked the file you provided in your former post and it is working perfectly. Thanks for the help. That was exactly what I needed.

By the way what does this (WHERE 1 = 0) where condition do. I failed to understand it.
 

strive4peace

AWF VIP
Local time
Today, 00:27
Joined
Apr 3, 2020
Messages
1,003
hi @Pac-Man

> By the way what does this (WHERE 1 = 0) where condition do. I failed to understand it.

This makes no current records be in the recordset (1=0 is False). Since records are being added, the recordset doesn't need to have what is already there ~
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 05:27
Joined
Sep 21, 2011
Messages
14,048
I used to use that, until I found there was a dbAppendOnly option. :)
 

petertheme

New member
Local time
Today, 05:27
Joined
Feb 25, 2022
Messages
12
This may be useful. A little more involved than I first thought.

In a target database It adds a table containing a default theme that you have chosen for that database.
Adding a call to "CheckUsingDefaultTheme()" in the autoexec or startup code will check if the theme has been changed from the default and reset if wanted.

This overcomes the fear of having a theme "Lost" as some people have expressed as a reason for not using themes.


DefaultThemeSetting.png


I have been thinking about this but with your users being able to change theme It makes sense to provide a way of returning to the original.
Any comments will be welcome. This provides basic functionality but can be enhanced. It is in accdb format.
 

Attachments

  • SetDefaultTheme.zip
    49 KB · Views: 114
Last edited:

Pac-Man

Active member
Local time
Today, 10:27
Joined
Apr 14, 2020
Messages
408
Thanks a lot @petertheme for the db and help, @strive4peace, @isladogs, @Gasman for input.

The way I implemented in my db is user select the theme from a combo (with rowsource from a table which contain path to the corresponding theme file as all theme files are stored locally in certain folder) and attachment is updated in the Resources table so there is even no need of updating the property. Default theme can be reselect from the combo if user wants it.
 

Pac-Man

Active member
Local time
Today, 10:27
Joined
Apr 14, 2020
Messages
408
There is one thin more, theme is updated after restarting the db. Is it possible to see the changed theme without having to restart the db?
 

Garcimat

Member
Local time
Today, 16:27
Joined
Jun 7, 2022
Messages
67
Sorry, I could not access the zip file, I tried again now and it worked fine.
Thank you
 

Users who are viewing this thread

Top Bottom