Change tab/background colour on the tabContainer control in MS Access?

G

Grahammer

I'm using the tabControl for a data entry form and it works quite well, with
one small problem...

The default grey appearance of the tabs and tab area looks very shoddy on my
form. Is there a way to change the color of the background on the tabs and
the tabs background area? I'll even try an API call if necessary.

Thanks!!!
 
S

Stephen Lebans

See:
http://www.lebans.com/tabcolors.htm
Tabs.zip is an MDB containing a class to enhance the standard Access TAB
control in order to allow for:

1) Tabs of any color
2) Rotated Text

Notes:
You must set the Tab controls TAB Fixed Height and Width properties
You must set the Individual Tab pages TAG property to whatever color
value you desire.



History
Version 1.6
Added support to allow for the coloring of just the Current/Active TABS
and not the background of the Tab control

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
K

Kentucky5

I have buttons on my form that if on that particular
subform there is data entered it would change the color of
the button associated with that, how would I do that?
 
A

Al Borges

Hi:

What you need to do is to place a conditional colored bitmap scheme for the
tabs. This is how I would handle this problem that you wish to tackle; say
you have 3 subform folders-

Dim rst as recordset
Set rst = Forms![YourFocusForm]![Subform1].form.RecordsetClone
rst.movefirst
rst.movelast
If rst.recordcount > 0 Then
page1.picture = "C:\RedBackground.bmp"
else
page1.picture = "C:\BlueBackground.bmp"
End If

Set rst = Forms![YourFocusForm]![Subform2].form.RecordsetClone
rst.movefirst
rst.movelast
If rst.recordcount > 0 Then
page2.picture = "C:\RedBackground.bmp"
else
page2.picture = "C:\BlueBackground.bmp"
End If

Set rst = Forms![YourFocusForm]![Subform3].form.RecordsetClone
rst.movefirst
rst.movelast
If rst.recordcount > 0 Then
page3.picture = "C:\RedBackground.bmp"
else
page3.picture = "C:\BlueBackground.bmp"
End If
rst.Close

That should work for you... at least theoretically. Let us know if it works!

Regards,
Al
 
K

Kentucky5

Al,
Thank you I will try this and definitely let you know if
it works or not.
-----Original Message-----
Hi:

What you need to do is to place a conditional colored bitmap scheme for the
tabs. This is how I would handle this problem that you wish to tackle; say
you have 3 subform folders-

Dim rst as recordset
Set rst = Forms![YourFocusForm]! [Subform1].form.RecordsetClone
rst.movefirst
rst.movelast
If rst.recordcount > 0 Then
page1.picture = "C:\RedBackground.bmp"
else
page1.picture = "C:\BlueBackground.bmp"
End If

Set rst = Forms![YourFocusForm]! [Subform2].form.RecordsetClone
rst.movefirst
rst.movelast
If rst.recordcount > 0 Then
page2.picture = "C:\RedBackground.bmp"
else
page2.picture = "C:\BlueBackground.bmp"
End If

Set rst = Forms![YourFocusForm]! [Subform3].form.RecordsetClone
rst.movefirst
rst.movelast
If rst.recordcount > 0 Then
page3.picture = "C:\RedBackground.bmp"
else
page3.picture = "C:\BlueBackground.bmp"
End If
rst.Close

That should work for you... at least theoretically. Let us know if it works!

Regards,
Al

I have buttons on my form that if on that particular
subform there is data entered it would change the color of
the button associated with that, how would I do that?

Width
properties if
necessary.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top