Re: Tab Colors in Access2000



Thanks. Now I am getting the following error when I try to view the form:
The expression On Load you entered as teh event property setting produced the
following error: User-defined type not defined. What do I need to define for
this? I've got to be close, because I keep looking at TabColorExample code
and my code and I don't see what else is different.

I tried to follow your instructions. I did the following: set TabControl
itself Fixed H/ W, set each page's tag property to a different color, and
included the code exactly like your sample. I then renamed my Tab control
and Rectangle control to match the code sample.



Stephen Lebans wrote:
Here is a previous post of mine on this subject:

' **********************************************
From: Stephen Lebans (NoEm...@xxxxxxxxxx)
Subject: Re: Background color on a "tab" form
View: Complete Thread (5 articles)
Original Format
Newsgroups: microsoft.public.access.formscoding
Date: 2002-01-30 16:26:05 PST

Open your form in Design view.

Select the TAB control itself...not one of the individual TAB pages. Enter a
value for the Tab Fixed Height and Width properties.

Now Select each of the individual TAB Pages in turn. Enter a color RGB value
in each Page's TAG property. If you are unfamiliar with RGB color codes
simply enter 255 for now.

You have to take the time to look at the code behind the sample Form. As you
can see from the code below you have to add code to the following
Sections/Events behind your Form/Tab control.

1) The Declarations section at the top of your Form
2) The Form Load and UnLoad events
3) The Tab control Change event.

The only things you have to change are the names of your Tab control and
the Rectangle control used to simulate a color for the Background of the
Tab control.
So in the sample, I named the TAB control "tabCtl" and the Rectangle
control "RecBG".
Just change these names to those of the controls you are using on your
Form.
Me.TabCtl
Me.RecBG

There's nothing else to tell you. If you are not comfortable implementing
this code solution then honestly you simply should not use it.

Good Luck.

' Here's the code behind the sample Form.

Option Compare Database
Option Explicit

' Var of type Tab class
Private TB As clsTabs

Private Sub Form_Load()
'DoCmd.MoveSize 0, 0, 6650, 4800

' Create an instance of our TabColors class
Set TB = New clsTabs

' You MUST set the TabControl prop
TB.TabControl = Me.TabCtl
' You MUST set the BackGround control
' used to display the current pages background color
TB.BGControl = Me.RecBG
' Parent Form
TB.TabForm = Me

' Set the desired Rotation amount
TB.RotateDegree = 90

' Create the Tabs
TB.MakeTabs

End Sub

Private Sub Form_Unload(Cancel As Integer)
Set TB = Nothing
End Sub

' **********************************************

I have looked at http://www.lebans.com/tabcolors.htm, however, I'm still
not
able to get my tabs to change color. Can I accomplish this by setting
attributes in Properties for each tab (i.e. same width and height, and
different tag #s)? Or do I have to write VB code (which I don't have any
experience in)?

--
Message posted via http://www.accessmonster.com

.



Relevant Pages

  • Re: Tab Colors in Access2000
    ... Do you have the class clsTabs from Stephen's sample? ... Background color on a "tab" form ... Select the TAB control itself...not one of the individual TAB pages. ...
    (microsoft.public.access.forms)
  • Re: Tab Controls
    ... seems to be what you did regarding tab controls. ... Background color on a "tab" form ... Select the TAB control itself...not one of the individual TAB pages. ... Candia Computer Consulting - Candia NH ...
    (microsoft.public.access.forms)
  • Re: Tab Controls
    ... Candia Computer Consulting - Candia NH ... seems to be what you did regarding tab controls. ... Background color on a "tab" form ... Select the TAB control itself...not one of the individual TAB pages. ...
    (microsoft.public.access.forms)
  • Re: Tab Colors in Access2000
    ... Background color on a "tab" form ... Select the TAB control itself...not one of the individual TAB pages. ... Please respond only to the newsgroups so everyone can benefit. ...
    (microsoft.public.access.forms)
  • Re: Tab Controls
    ... Candia Computer Consulting - Candia NH ... about the color of the font or the background color. ... Make the BackStyle of the Tab Control Transparent. ...
    (microsoft.public.access.forms)

Loading