TrkItems.Add (method)

Syntax: TrkItem = object.Add ( bstrID )
bstrID As String -
Tracker Item ID
Adds a new TrkItem objects to the TrkItems Collection.


Dim oTADBRoot As Object
Dim oTrkItem As Object

Set oTADBRoot = CreateObject("TADB.TADBRoot")

If oTADBRoot Is Nothing Then
   MsgBox "Root Object is not created"
End If

oTADBRoot.Load "TRK7", ""

oTADBRoot.TrkItems.ReadDB "AnyItemID"
If oTADBRoot.TrkItems.Count > 0 Then
'This means the Database contains records matching "AnyItemID".
'All the records that match "AnyItemID" are returned as TrkItem objects in TrkItems Collection
'Use TrkItem methods to manipulate the individual TrkItem objects in the collection.
Set oTrkItem = oTADBRoot.TrkItems.Add("AnyItemID")
     If Not oTrkItem Is Nothing Then
         oTrkItem.ReferenceID = "ItemRefID"
         oTrkItem.ItemTypeID = "ItemTypeID"
         oTrkItem.Save 'Add the item to the database.
         MsgBox "Error adding the item in Items collection.".
     End If
End If