CurrentIDOCollection property (WinStudio scripts)

Applies To

IWSForm interface

Definition

Returns a Visual Basic variable object that references the current IDO collection on the specified form, or sets the IDO collection object as the current IDO collection on the specified form.

Get Syntax

object.CurrentIDOCollection

  Part   Description
object Required. A reference to a form object.

Set Syntax

object.CurrentIDOCollection = varObject

  Part   Description
object Required. A reference to a form object.
varObject Required. A Visual Basic variable that is defined as an object and that references the IDO collection object on the form.

Remarks

Unless you specify otherwise (by using the Set syntax), this property assumes the current IDO collection is the primary IDO collection.

Example

This example assumes you are on a form with a secondary collection. The first message displays the index number of the currently selected row. The second message displays some properties associated with that record and the total number of rows in that collection. The third and fourth messages display the same information with respect to a secondary collection.

Sub Main()
   Dim oCache As IWSIDOCollection
   oCache = ThisForm.CurrentIDOCollection
   Application.ShowMessage((oCache.GetCurrentObjectIndex() + 1).ToString())
   Application.ShowMessage("Save: " & oCache.SaveEnabled.ToString() _
      & vbLf & "Delete: " & oCache.DeleteEnabled.ToString() & vbLf & _
      "Number of rows: " & (oCache.GetNumEntries() - 1).ToString())
   ThisForm.CurrentIDOCollection = ThisForm.GetSecondaryIDOCollection(2)
   oCache = ThisForm.CurrentIDOCollection
   Application.ShowMessage((oCache.GetCurrentObjectIndex() + 1).ToString())
   Application.ShowMessage("Save: " & oCache.SaveEnabled.ToString() _
      & vbLf & "Delete: " & oCache.DeleteEnabled.ToString() & vbLf & _
      "Number of rows: " & oCache.GetNumEntries().ToString())
End Sub