Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Posts
    59

    Unanswered: Listview Subitem to database

    Hi!

    I have a populated ListView with three columns (ID, FirstName, Last Name). I need to be able to pull the information from the SubItems and place them back into a database.

    So, I know I can get the SelectedItem.Text which will give me the data from the first field (ID), but how do I pull the rest?

    I've tried code like:
    rs!ID = ListView1.SelectedItem.Text '(which works btw)
    rs!Firstname = ListView1.SelectedItem.SubItem(1).Text '(does not work)
    rs!Firstname = ListView1.SelectedItem.ListSubitems(1).Item.Text '(does not work)

    So, I basically need to find the right syntax, and as of late I could not.

    Best Regards - Matt-
    -Matt H-
    www.comperfection.com

  2. #2
    Join Date
    May 2004
    Posts
    97
    Have you tried simply..

    rs!Firstname = ListView1.SelectedItem.SubItem(1)

  3. #3
    Join Date
    May 2004
    Posts
    9
    Try Listview1.Listitem(Index).Listsubitem(Index2)

    You can find the index by using Listview1.Selecteditem.Index

  4. #4
    Join Date
    Oct 2004
    Location
    In cousin's house
    Posts
    303
    Try this my friend

    While Counter <= lV2.ListItems.Count
    Value1 = lV.ListItems.Item(Counter)
    Value2= lV.ListItems.Item(Counter).SubItems(1)
    Counter = Counter + 1
    Wend

Posting Permissions

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