|
 |
access thread: hiding a page in a tab control
Message #1 by "Howard Stone" <ququmber@h...> on Wed, 20 Nov 2002 22:17:18
|
|
I want to hide one of the page on a tab control. I checked the help filed
but I cannot find anything that shows me how to do it.
Thanks
Message #2 by John Fejsa <John.Fejsa@h...> on Thu, 21 Nov 2002 10:21:37 +1100
|
|
You can use Pages to show/hide required pages. For example,
Me!tabMyTabControl.Pages(intCounter).Visible = False 'Using Variable
OR
Me!tabMyTabControl.Pages(1).Visible = True 'Using number to hide the
second tab
Tab pages start from zero (first tab is 0, second 1 etc...)
Hope it helps...
____________________________________________________
John Fejsa
Systems Analyst/Computer Programmer
Hunter Centre for Health Advancement
Locked Bag 10, WALLSEND NSW 2287
Phone: (02) 4924 6336 Fax: (02) 4924 6209
www.hcha.org.au
____________________________________________________
The doors we open and close each day decide the lives we live
____________________________________________________
CONFIDENTIALITY & PRIVILEGE NOTICE
>>> ququmber@h... 21/11/2002 9:17:18 >>>
I want to hide one of the page on a tab control. I checked the help
filed
but I cannot find anything that shows me how to do it.
Thanks
This message is intended for the addressee named
and may contain confidential information.
If you are not the intended recipient, please
delete it and notify the sender.
Views expressed in this message are those of the
individual sender, and are not necessarily the
views of Hunter Health.
Message #3 by "bwarehouse" <bwarehouse@y...> on Thu, 21 Nov 2002 01:10:37 -0700
|
|
Get the name of the tab, and set its visible property to no.. like this
On my form I have a tab control with 2 tabs.
The tab control itself is named Tabctl7
Tab 1 is named tab1
Tab 2 is named tab2
****now if I wanted to hide tab2 using vb, the code would be:
Me.tab2.visible = No
Or, while in design view of the form, I would click tab2
And choose properties, goto visible, and change it from yes to no.
That's it.
Later,
bware
-----Original Message-----
From: Howard Stone [mailto:ququmber@h...]
Sent: Wednesday, November 20, 2002 10:17 PM
To: Access
Subject: [access] hiding a page in a tab control
I want to hide one of the page on a tab control. I checked the help filed
but I cannot find anything that shows me how to do it.
Thanks
Message #4 by John Fejsa <John.Fejsa@h...> on Tue, 26 Nov 2002 09:08:16 +1100
|
|
You can also use page index number to hide/show number of various pages.
For example, we use the following procedure to select and show only one
type page from 12 type pages on the tab control. Hope the folowing
example is of some assistance.
Sub ShowOrHideTabPages(strLastControl As String)
'This procedure will either display or hide a tab page depending
'on the dissemination type selected by the user
On Error GoTo Err_ShowOrHideTabPages
Dim intNoTabPages As Integer
Me!cmbTypeID.SetFocus
CustomiseInformationText 'Set Status and Control tip text
Me!tabDisDetails.Visible = True
If IsNull(Me!cmbTypeID.Column(2)) Then
intRequiredPage = 0
Else
intRequiredPage = Me!cmbTypeID.Column(2) 'Required tab number
End If
intNoTabPages = Me!tabDisDetails.Pages.Count - 1 'Total number of
pages on the tab control
If intRequiredPage < 0 Or intRequiredPage >
Me!tabDisDetails.Pages.Count Then
strMsg = "Critical Error!" _
& "@Error selecting active tabs." _
& "@Please inform the programmer about this error
immediately."
beep
MsgBox strMsg, vbCritical, "Invalid Tab Request Detected!"
Else
For intCounter = 4 To intNoTabPages 'First 4 pages are always
visible for all types (index starts from zero)
'Show/Hide Tabs
If intCounter = intRequiredPage Then
Me!tabDisDetails.Pages(intCounter).Visible = True
'Display required tab
If intRequiredPage = conPaperPages Then 'Paper
dissemination specific set up
If Me!cmbTypeID = conPaper Then
Me!frmCurrentStatus.Visible = True
Me!lblStatuslDate.Visible = True
Me!PeerReviewPaper.Visible = True
Me!lblCitations.Top = dblCitationsTop
Me!Citations.Top = dblCitationsTop
Else
Me!frmCurrentStatus.Visible = False
Me!lblStatuslDate.Visible = False
Me!PeerReviewPaper.Visible = False
Me!lblCitations.Top = dblCitationsTop - (2.87 *
conTWIPS)
Me!Citations.Top = dblCitationsTop - (2.87 *
conTWIPS)
End If
End If
If intRequiredPage = conBookPages Then 'Book
dissemination specific set up
If Me!cmbTypeID = conBookChapter Then
Me!lblPublishingCoBook.Top
dblPublishingCoBookTop
Me!cmbPublishingCoBook.Top
dblPublishingCoBookTop
Me!lblPubPlaceBook.Top = dblPubPlaceBookTop
Me!cmbPubPlaceBook.Top = dblPubPlaceBookTop
Me!ChapterBook.Visible = True
Me!StartPageNoBook.Visible = True
Me!EndPageNoBook.Visible = True
Me!ISSN_ISBN_Book.Visible = True
Me!lblISBNHelp.Visible = True
Me!optDistributionBook.Visible = True
Me!PeerReviewBook.Visible = True
Else
Me!ChapterBook.Visible = False
Me!StartPageNoBook.Visible = False
Me!EndPageNoBook.Visible = False
Me!ISSN_ISBN_Book.Visible = False
Me!lblISBNHelp.Visible = False
Me!optDistributionBook.Visible = False
Me!lblPublishingCoBook.Top
dblPublishingCoBookTop - (0.72 * conTWIPS)
Me!cmbPublishingCoBook.Top
dblPublishingCoBookTop - (0.72 * conTWIPS)
Me!lblPubPlaceBook.Top = dblPubPlaceBookTop -
(0.72 * conTWIPS)
Me!cmbPubPlaceBook.Top = dblPubPlaceBookTop -
(0.72 * conTWIPS)
Me!PeerReviewBook.Visible = False
End If
End If
If intRequiredPage = conProjectReportPages Then 'Project
Report dissemination specific set up
Me!cmbPubPlaceProjReport = Null
Me!cmbPubPlaceProjReport.Visible
Me!chkInhouseReport
lblPublishingCoProjReport.Visible
Me!chkInhouseReport
Me!ReportFileLocation = Me!chkInhouseReport
Me!lblAuto.Visible = Me!chkInhouseReport
Me!cmdGetFileName.Visible = Me!chkInhouseReport
End If
Else
Me!tabDisDetails.Pages(intCounter).Visible = False
End If
Next intCounter
SetTabTitle
End If
Me.Controls(strLastControl).SetFocus 'Set focus to last know control
(Title/Type)
Exit_ShowOrHideTabPages:
Exit Sub
Err_ShowOrHideTabPages:
MsgBox Error$, vbCritical, "Error Setting Information Tabs
(ShowOrHideTabPages sub)."
Resume Exit_ShowOrHideTabPages
End Sub
____________________________________________________
John Fejsa
Systems Analyst/Computer Programmer
Hunter Centre for Health Advancement
Locked Bag 10, WALLSEND NSW 2287
Phone: (02) 4924 6336 Fax: (02) 4924 6209
www.hcha.org.au
____________________________________________________
The doors we open and close each day decide the lives we live
____________________________________________________
CONFIDENTIALITY & PRIVILEGE NOTICE
>>> bwarehouse@y... 21/11/2002 19:10:37 >>>
Get the name of the tab, and set its visible property to no.. like this
On my form I have a tab control with 2 tabs.
The tab control itself is named Tabctl7
Tab 1 is named tab1
Tab 2 is named tab2
****now if I wanted to hide tab2 using vb, the code would be:
Me.tab2.visible = No
Or, while in design view of the form, I would click tab2
And choose properties, goto visible, and change it from yes to no.
That's it.
Later,
bware
-----Original Message-----
From: Howard Stone [mailto:ququmber@h...]
Sent: Wednesday, November 20, 2002 10:17 PM
To: Access
Subject: [access] hiding a page in a tab control
I want to hide one of the page on a tab control. I checked the help
filed
but I cannot find anything that shows me how to do it.
Thanks
This message is intended for the addressee named
and may contain confidential information.
If you are not the intended recipient, please
delete it and notify the sender.
Views expressed in this message are those of the
individual sender, and are not necessarily the
views of Hunter Health.
|
|
 |