TrkRecords.Remove (method)

method Remove
Syntax: object.Remove bstrID
bstrID As String -
ID of the record that needs to be removed.
Removes the record from TrkRecords collection as well as from the source database. To remove a record from the collection, the TrkRecord ID is required. This ID is the sequence number of the collection in TrkRecord collection and is generated internally.

Example 1:

'Get Table from Collection of TrkTables
Set oTrkTable = oTADBRoot.TrkTables.Item("GroupAttribs^BODY COMPONENT^Body IDs")
'TrkTable Found ...
oTrkTable.ReadDB "Item3"
If oTrkTable.TrkRecords.Count = 1 then
Set oTrkRecord = oTrkTable.TrkRecords.Item(1)
 oTrkTable.TrkRecords.Remove oTrkRecord.ID
       'Record not found...
End If

Example 2:

' Remove all records from the collection
oTrkTable.ReadDB "ItemID"
If oTrkTable.TrkRecords.Count > 0 then
    For Each ListItem in oTrkTable.TrkRecords
        oTrkTable.TrkRecords.Remove ListItem.ID
End If