Results 1 to 4 of 4

Thread: referecing more than one ListView in a sub

  1. #1

    Thread Starter
    Frenzied Member Blobby's Avatar
    Join Date
    Oct 2001
    Location
    England
    Posts
    1,512

    referecing more than one ListView in a sub

    Morning chaps and chapesses,

    I have a sub that makes several references to a ListView. Ive now added another listview to the form. Is it possible to make the listview name in my sub flexible so i can reference both Listviews depending on the listview name passed into the sub to save writing an identical sub? Thanks
    There are 3 types of people in this world.........those that can count, and those that can't.

    Blobby

  2. #2
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724
    Just pass the listview itself to the sub
    VB Code:
    1. Private Sub doSomeThing(objListView As ListView)
    2.   MsgBox objListView.Name & " - " & objListView.ListItems.Count
    3. End Sub

  3. #3

    Thread Starter
    Frenzied Member Blobby's Avatar
    Join Date
    Oct 2001
    Location
    England
    Posts
    1,512
    Thanks Axion i figured maybe i could do something like that but wasnt sure if x.listitems.listcount would be valid syntax.
    Thanx for the confirmation
    There are 3 types of people in this world.........those that can count, and those that can't.

    Blobby

  4. #4
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724
    My pleasure

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