Results 1 to 2 of 2

Thread: Using collections....please help!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Location
    Boulder, Colorado
    Posts
    22

    Question

    Can anyone explain how to use collections (i.e. control collections). Please give examples.
    C-Dog

  2. #2
    Guest
    Try this. The following example requires a Form with 2 CommandButtons and a ListBox

    Code:
    Dim X As Collection
    
    Private Sub Command1_Click()
        'Add an item to the collection
        X.Add InputBox("Enter a name")
    End Sub
    
    Private Sub Command2_Click()
        'Display all the items in the collection
        For I = 1 To X.Count
            List1.AddItem X(I)
        Next I
    End Sub
    
    Private Sub Form_Load()
        'Create the collection
        Set X = New Collection
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width