Why Background of Tab Control is White

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gazelle04
    New Member
    • Jul 2006
    • 52

    Why Background of Tab Control is White

    I've created a tab control on a form. Why is the background of the control is white. I don't know why. Sometimes its color is normal just an ordinary from color. I'm using an Access 2003. It also happens when I imported a form with tab control from another form. The background of tab control becomes "white".

    Can anybody tell me why? How to solve this problem.
  • PEB
    Recognized Expert Top Contributor
    • Aug 2006
    • 1418

    #2
    Hi,

    Reelly sometimes it's white! I've seen in the tab properties and there isn't a property for the color! Maybe it gets the color from the main form but sometimes it gives a bug!

    When you try the change the color the tool isn't available! Strange!

    I'm nearby sure that it can be corrected by Visual Basic! For more info it's good to see in MS Access help:


    Page Object
    See Also Properties Methods Events Specifics
    Pages
    Page
    Properties


    A Page object corresponds to an individual page on a tab control.

    Using the Page Object
    A Page object is a member of a tab control's Pages collection.

    To return a reference to a particular Page object in the Pages collection, use any of the following syntax forms.

    Syntax Description
    Pages!pagename The pagename argument is the name of the Page object.
    Pages("pagename ") The pagename argument is the name of the Page object.
    Pages(index) The index argument is the numeric position of the object within the collection.


    You can create, move, or delete Page objects and set their properties either in Visual Basic or in form Design view. To create a new Page object in Visual Basic, use the Add method of the Pages collection. To delete a Page object, use the Remove method of the Pages collection.

    To create a new Page object in form Design view, right-click the tab control and then click Insert Page on the shortcut menu. You can also copy an existing page and paste it. You can set the properties of the new Page object in form Design view by using the property sheet.

    Each Page object has a PageIndex property that indicates its position within the Pages collection. The Value property of the tab control is equal to the PageIndex property of the current page. You can use these properties to determine which page is currently selected after the user has switched from one page to another, or to change the order in which the pages appear in the control.

    A Page object is also a type of Control object. The ControlType property constant for a Page object is acPage. Although it is a control, a Page object belongs to a Pages collection, rather than a Controls collection. A tab control's Pages collection is a special type of Controls collection.

    Each Page object can also contain one or more controls. Controls on a Page object belong to that Page object's Controls collection. In order to work with a control on a Page object, you must refer to that control within the Page object's Controls collection.



    Show All

    Properties Collection
    See Also Properties Methods Events Specifics
    Multiple objects
    Properties


    The Properties collection contains all of the built-in properties in an instance of an open form, report, or control. These properties uniquely characterize that instance of the object.

    Using the Properties Collection
    Use the Properties collection in Visual Basic or in an expression to refer to form, report, or control properties on forms or reports that are currently open.

    Tip The For Each...Next statement is useful for enumerating a collection.

    You can use the Properties collection of an object to enumerate the object's built-in properties. You don't need to know beforehand exactly which properties exist or what their characteristics (Name and Value properties) are to manipulate them.

    Note In addition to the built-in properties, you can also create and add your own user-defined properties. To add a user-defined property to an existing instance of an object, see the AccessObjectPro perties collection and Add method topics.

    The following example enumerates the Forms collection and prints the name of each open form in the Forms collection. It then enumerates the Properties collection of each form and prints the name of each property and value.

    Sub AllOpenForms()
    Dim frm As Form, prp As Property

    ' Enumerate Forms collection.
    For Each frm In Forms
    ' Print name of form.
    Debug.Print frm.Name
    ' Enumerate Properties collection of each form.
    For Each prp In frm.Properties
    ' Print name of each property.
    Debug.Print prp.Name; " = "; prp.Value
    Next prp
    Next frm
    End Sub

    Comment

    • gazelle04
      New Member
      • Jul 2006
      • 52

      #3
      Thans Peb for your response. Yes its a bug. Sometimes the background of tab is normal sometimes its white. I don't know why. It usually happens when I import a form from another database. I think since Access 97 I'm encountering this bug whenever I import a form.Just last month I've created a database with normal tab control background but now I could not re-create it, it now gives me a white background.

      Comment

      • PEB
        Recognized Expert Top Contributor
        • Aug 2006
        • 1418

        #4
        Later today I'll try to change the color property programaically of a Tab control and I'll post the results :)

        Comment

        • PEB
          Recognized Expert Top Contributor
          • Aug 2006
          • 1418

          #5
          Good! I've ran the properties of one form with the goal to see wich i s the property that determine the color of the background After me the properties in bold are possibilities:

          Form1
          RecordSource =
          Filter =
          FilterOn = False
          OrderBy =
          OrderByOn = False
          AllowFilters = True
          Caption =
          DefaultView = 0
          ViewsAllowed = 0
          AllowFormView = True
          AllowDatasheetV iew = True
          AllowPivotTable View = True
          AllowPivotChart View = True
          AllowEditing = True
          DefaultEditing = 2
          AllowEdits = True
          AllowDeletions = True
          AllowAdditions = True
          DataEntry = False
          AllowUpdating = 0
          RecordsetType = 0
          RecordLocks = 0
          ScrollBars = 3
          RecordSelectors = True
          NavigationButto ns = True
          DividingLines = True
          AutoResize = True
          AutoCenter = False
          PopUp = False
          Modal = False
          BorderStyle = 2
          ControlBox = True
          MinButton = True
          MaxButton = True
          MinMaxButtons = 3
          CloseButton = True
          WhatsThisButton = False
          Width = 6975
          Picture = (none)
          PictureType = 0
          PictureSizeMode = 0
          PictureAlignmen t = 2
          PictureTiling = False
          Cycle = 0
          MenuBar =
          Toolbar =
          ShortcutMenu = True
          ShortcutMenuBar =
          GridX = 10
          GridY = 10
          LayoutForPrint = False
          FastLaserPrinti ng = True
          HelpFile =
          HelpContextId = 0
          SubdatasheetHei ght = 0
          SubdatasheetExp anded = False
          RowHeight = -1
          DatasheetFontNa me = Arial
          DatasheetFontHe ight = 10
          DatasheetFontWe ight = 400
          DatasheetFontIt alic = False
          DatasheetFontUn derline = False
          DatasheetGridli nesBehavior = 3
          DatasheetGridli nesColor = 12632256
          DatasheetCellsE ffect = 0
          DatasheetForeCo lor = 0
          ShowGrid = True
          DatasheetBackCo lor = 16777215 DatasheetBorder LineStyle = 1
          HorizontalDatas heetGridlineSty le = 1
          VerticalDatashe etGridlineStyle = 1
          DatasheetColumn HeaderUnderline Style = 1
          Hwnd = 460
          Count = 3
          LogicalPageWidt h = 9335
          Visible = True
          Painting = True
          PrtMip = ? ? ? ? ? ?   U ?  
          PrtDevMode = ??? ?Ѓ???b??d? ?  ? ?   ?????  ? d ? ? ? ? ? ? ? ??? ? ???????1 ? ? ??????2 ? ? ??????3 ? ?
          PrtDevNames = %??????????r ????????T
          FrozenColumns = 1
          Name = Form1
          PaletteSource = (Default)
          Tag =
          PaintPalette = Null
          OpenArgs = Null
          OnCurrent =
          BeforeInsert =
          AfterInsert =
          BeforeUpdate =
          AfterUpdate =
          OnDirty =
          OnUndo =
          OnDelete =
          BeforeDelConfir m =
          AfterDelConfirm =
          OnOpen =
          OnLoad =
          OnResize =
          OnUnload =
          OnClose =
          OnActivate =
          OnDeactivate =
          OnGotFocus =
          OnLostFocus =
          OnClick =
          OnDblClick =
          OnMouseDown =
          OnMouseMove =
          OnMouseUp =
          OnMouseWheel =
          OnKeyDown =
          OnKeyUp =
          OnKeyPress =
          KeyPreview = False
          OnError =
          OnFilter =
          OnApplyFilter =
          OnTimer =
          TimerInterval = 0
          BeforeScreenTip =
          OnCmdEnabled =
          OnCmdChecked =
          OnCmdBeforeExec ute =
          OnCmdExecute =
          OnDataChange =
          OnDataSetChange =
          OnPivotTableCha nge =
          OnSelectionChan ge =
          OnViewChange =
          OnConnect =
          OnDisconnect =
          BeforeQuery =
          OnQuery =
          AfterLayout =
          BeforeRender =
          AfterRender =
          AfterFinalRende r =
          WindowWidth = 7680
          WindowHeight = 4620
          CurrentView = 1
          CurrentSectionT op = 0
          CurrentSectionL eft = 285
          SelLeft = 1
          SelTop = 1
          SelWidth = 0
          SelHeight = 0
          PictureData = Null
          InsideHeight = 3900
          InsideWidth = 7260
          PicturePalette = Null
          HasModule = False
          Orientation = 0
          AllowDesignChan ges = True
          WindowTop = 600
          WindowLeft = 270
          Moveable = True
          FetchDefaults = True


          When I try the follow:
          ?Forms("Form1") .Controls("TabC tl0").Pages("Pa ge1").Datasheet BackColor

          unfortunatelly it gives me a message for error! Access can't find this property!

          So for the moment I don't find out how to correct the problem with the white Tab background!

          Comment

          • VicRauch
            New Member
            • Feb 2007
            • 1

            #6
            The tab control takes on the color of the form behind the tab control. So, if you want the tab control the color that the tabs are, use -2147483633 as the Back Color for the portion of the form (Detail, Header, or Footer) the tab control is on. It appears that the tab control takes on a Transparent property.

            Comment

            Working...