Skip to content

Parent


Overview

The Parent property of the Account class returns the Accounts collection that the Account instance is part of.

Syntax

vba
Account.Parent

Return Value

Returns an Accounts object representing the collection that contains this Account instance.

Example

In this code snippet, we use the Parent property to access the parent Accounts collection and display the total number of accounts in that collection:

vba
Sub DisplayParentAccountInfo(acc As Account)
    ' Retrieve the parent Accounts collection from the account
    Dim parentAccounts As Accounts
    Set parentAccounts = acc.Parent

    ' Display the total number of accounts in the parent collection
    MsgBox "Total accounts in the parent collection: " & parentAccounts.Count, vbInformation
End Sub