Label color save

kriszty

New member
Local time
Today, 02:34
Joined
Aug 28, 2015
Messages
4
just simple question

is it possible in vba to save the backcolor/forcolor for a label ?

if i change the color of a label like
scan1.BorderColor = RGB(255, 0, 0) the color changes as it should, but if i close the form , and restart it comes back with the original label color

is this possible

greetings, patrick
 
You would need to open the form in design view, make the change, then save the form and close it.
 
You would need to open the form in design view, make the change, then save the form and close it.

yes i know, but i need to vba code this , closing the form in designer mode is not the solution for this.
 
well... maybe this is not what you are looking for but why not save the new label colour in a table and on load for the form look for the label colour for that particular label in the table. gives you all the control you could want for all graphical elements in your db....

Hope it helps...
 
yes i know, but i need to vba code this , closing the form in designer mode is not the solution for this.

Have you attempted this? If not, then why ask for help if you're not going to try what information is given to you? I have successfully done what you are trying to do by using the method I recommended.
Everything I said can be done in VBA.
 
Last edited:
how do you actually change the label colour, if not in design mode?

if it is a permanent change, then change it in design mode. If not, then if it's a volatile setting, you need to store the value somewhere, or evaluate it at runtime based on your table data. You could store it in a table, in the registry, or in a text file.
 
i just solved it , the labels should have 2 different colors , so i gave color 1 status1 and color 2 status2 , when the form is loaded it checks the status number, it made my vba code a bit longer but it works.

see attachment.

advice is welcome , if i can write a better code :)
 

Attachments

Users who are viewing this thread

Back
Top Bottom