Table of contents
Collapse the table of content
Expand the table of content

Pages.Remove Method (Access)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

The Remove method removes a Page object from the Pages collection of a tab control.


expression. Remove( ** Item** )

expression A variable that represents a Pages object.


NameRequired/OptionalData TypeDescription
ItemOptionalVariantAn integer that specifies the index of the Page object to be removed. The index of the Page object corresponds to the value of the PageIndex property for that Page object. If you omit this argument, the last Page object in the collection is removed.


The Pages collection is indexed beginning with zero. The leftmost page in the tab control has an index of 0, the page immediately to the right of the leftmost page has an index of 1, and so on.

You can remove a Page object from the Pages collection of a tab control only when the form is in Design view.


The following example removes pages from a 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 
 RemovePage = True 

 Exit Function 

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

See also


Pages Collection

© 2018 Microsoft