By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 2,140 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

Why Background of Tab Control is White

P: 52
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.
Aug 27 '06 #1
Share this Question
Share on Google+
5 Replies


PEB
Expert 100+
P: 1,418
PEB
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 AccessObjectProperties 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
Sep 2 '06 #2

P: 52
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.
Sep 2 '06 #3

PEB
Expert 100+
P: 1,418
PEB
Later today I'll try to change the color property programaically of a Tab control and I'll post the results :)
Sep 2 '06 #4

PEB
Expert 100+
P: 1,418
PEB
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
AllowDatasheetView = True
AllowPivotTableView = True
AllowPivotChartView = True
AllowEditing = True
DefaultEditing = 2
AllowEdits = True
AllowDeletions = True
AllowAdditions = True
DataEntry = False
AllowUpdating = 0
RecordsetType = 0
RecordLocks = 0
ScrollBars = 3
RecordSelectors = True
NavigationButtons = 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
PictureAlignment = 2
PictureTiling = False
Cycle = 0
MenuBar =
Toolbar =
ShortcutMenu = True
ShortcutMenuBar =
GridX = 10
GridY = 10
LayoutForPrint = False
FastLaserPrinting = True
HelpFile =
HelpContextId = 0
SubdatasheetHeight = 0
SubdatasheetExpanded = False
RowHeight = -1
DatasheetFontName = Arial
DatasheetFontHeight = 10
DatasheetFontWeight = 400
DatasheetFontItalic = False
DatasheetFontUnderline = False
DatasheetGridlinesBehavior = 3
DatasheetGridlinesColor = 12632256
DatasheetCellsEffect = 0
DatasheetForeColor = 0
ShowGrid = True
DatasheetBackColor = 16777215 DatasheetBorderLineStyle = 1
HorizontalDatasheetGridlineStyle = 1
VerticalDatasheetGridlineStyle = 1
DatasheetColumnHeaderUnderlineStyle = 1
Hwnd = 460
Count = 3
LogicalPageWidth = 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 =
BeforeDelConfirm =
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 =
OnCmdBeforeExecute =
OnCmdExecute =
OnDataChange =
OnDataSetChange =
OnPivotTableChange =
OnSelectionChange =
OnViewChange =
OnConnect =
OnDisconnect =
BeforeQuery =
OnQuery =
AfterLayout =
BeforeRender =
AfterRender =
AfterFinalRender =
WindowWidth = 7680
WindowHeight = 4620
CurrentView = 1
CurrentSectionTop = 0
CurrentSectionLeft = 285
SelLeft = 1
SelTop = 1
SelWidth = 0
SelHeight = 0
PictureData = Null
InsideHeight = 3900
InsideWidth = 7260
PicturePalette = Null
HasModule = False
Orientation = 0
AllowDesignChanges = True
WindowTop = 600
WindowLeft = 270
Moveable = True
FetchDefaults = True


When I try the follow:
?Forms("Form1").Controls("TabCtl0").Pages("Page1") .DatasheetBackColor

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!
Sep 2 '06 #5

P: 1
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.
Feb 19 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.