Item

ACCPAC Common Controls

AccpacViewKeys.Item

Returns a specific AccpacViewKey object in the collection, specified by its 0-based index in the collection or by its key name.

Function Item(Index As Variant) As AccpacViewKey
(default)

Parameters

Index

[in] the index of the AccpacViewKey object in the 0-based collection, or the key name

Return Value

Returns the AccpacViewKey object corresponding to the supplied index.

Remarks

Because the Item method is the default method for this collection, you do not have to specify "Item." For example, the following syntax forms are interchangeable:

Keys.Item(0)
Keys(0)
Keys.Item("name")
Keys("name")

Example

The following example retrieves the first key from the Bank Account's keys collection:
 

Dim BKACCT1header As AccpacCOMAPI.AccpacView

mDBLinkCmpRW.OpenView "BK0001", BKACCT1header

Dim keyBKACCT As AccpacCOMAPI.AccpacViewKey

Set keyBKACCT = BKACCT1header.Keys(0)