Tab Controls

PaulSpell

Registered User.
Local time
Today, 20:18
Joined
Apr 19, 2002
Messages
201
Does anyone know whether you can add additional tabs/pages to a tab control in Access 97?
 
You can - right click on the actual tab page and choose 'insert page'. HTH
 
Check for Add Method (the first one) in Help. Here's what I took from it, just in case you can't find it.

The following example adds a page to a tab control on a form that's in Design view. To try this example, create a new form named Form1 with a tab control named TabCtl0. Paste the following code into a standard module and run it:

Function AddPage() As Boolean
Dim frm As Form
Dim tbc As TabControl, pge As Page

On Error GoTo Error_AddPage
Set frm = Forms!Form1
Set tbc = frm!TabCtl0
tbc.Pages.Add
AddPage = True

Exit_AddPage:
Exit Function

Error_AddPage:
MsgBox Err & ": " & Err.Description
AddPage = False
Resume Exit_AddPage
End Function

The next example removes pages from the tab control:

Function RemovePage() As Boolean
Dim frm As Form
Dim tbc As TabControl, pge As Page

On Error GoTo Error_RemovePage
Set frm = Forms!Form1
Set tbc = frm!TabCtl0
tbc.Pages.Remove
RemovePage = True

Exit_RemovePage:
Exit Function

Error_RemovePage:
MsgBox Err & ": " & Err.Description
RemovePage = False
Resume Exit_RemovePage
End Function
 

Users who are viewing this thread

Back
Top Bottom