• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. The Real Scoop on Objects, P... > Returning to a Unique Item in a Coll...

Returning to a Unique Item in a Collection

The techniques you've learned so far don't allow you to return to a specific item in a collection. Using the Collection object's Key property, covered earlier in the chapter, you can easily return to a specific item in a collection. The code that follows illustrates this useful technique found in the frmTrackInstances form:

Private Sub cmdMore_Click()
   Call LocateInstance
End Sub

Sub LocateInstance()
   On Error Resume Next
   mcolForms.Item("" & PaymentID & "").SetFocus
   If Err.Number Then
      Call TrackInstances
   End If
End Sub


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint