Color Tab in VBA?
Solvedbibimtl2x Posted messages 54 Status Member -
Hello, I'm explaining what I wanted to do.
In my first tab, I select the task to do, and depending on the case, certain tabs are visible or not. (that's easy TabControl1.Pages(TabControl1).Visible)
For each task, there should be 5-6 tabs per theme of things to do before reaching the last one to conclude.
At the top of each tab, I have a menu: finished, pending, and completed.
What I wanted to do initially is when we choose finished, the tab in question turns green to show that it is completely done.
But here I am, and I believe I understand that we cannot change the colors of the tabs using VBA? Or does anyone have a solution?
I thought about adding a field at the top of each tab that updates accordingly and says finished, but since the visible tabs change according to what we choose in tab 1, that doesn't work either..
Does anyone have a solution for this? So that when opening the file we can immediately see what remains to be done (the incomplete tabs)?
Thank you :)
2 answers
Hello,
I don't know what you mean by "tab".
When I search for "tabcontrol access color", I find this, I don't know if it's useful: https://learn.microsoft.com/fr-ca/office/vba/api/Access.TabControl.BackColor
Well, I'm back on this part of my database
I found this site https://accessdatabasetutorial.com/controls-coloured-tabs-ms-access-form/ which seems to explain it well, but since it's in English, I don't understand much
I tried well (my first tab is named [Résumé] :
Private Sub Résumé_Click() Me.[Résumé].BackColor = "15523798" '#D6DFEC - light blue Me.tab0.FontBold = True End Sub to see if I can manage to change the color, but it really does nothing :(
any idea?
thank you :)
thank you :)
You can use DeepL, for example, to translate from English to French.
The author explains that, since it is impossible to change the color of the tabs, he conceived the idea of creating a form without tabs, a form that behaves more or less like a tabbed form.
The three fake tabs are also built on a single design.
Via VBA, when you click on one of the three labels at the top, it changes the appearance at the bottom, as if you were changing tabs. Since they are not tabs, you can change the color of each element at any time.
This may be more useful: a search for "Change tab color when selected on access tab control form".