Results 1 to 2 of 2

Thread: Listviewboxes and ADO

  1. #1

    Thread Starter
    Addicted Member AmmerBow's Avatar
    Join Date
    Sep 2000
    Posts
    195
    I very new to VB so i might have this whole concept wrong. this is what im trying to do:

    the following code would input info into the db using textboxs, etc to input the info.

    Code:
    Data1.Recordset.AddNew
     Data1.Recordset!ProjName = txtProjName.Text
     Data1.Recordset!lastname = txtlastName.Text
     Data1.Recordset!firstname = txtFirstName.Text
    data1.recordset.update
    Now I want to write a function that will output to a listviewbox. But i only want to list the projname and firstname

    Code:
    Set itmX = LstTasks.ListItems.Add(1, , ??????)
          itmX.SubItems(1) = ??????
    Can this be done?
    Is my thinking off?
    Thanks!






  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    Try something like:
    Code:
    Dim itmRecord As ListItem
    
    With Data1.Recordset
        Do Until .EOF
            Set itmRecord = ListView1.ListItems.Add(, , .Fields("ProjName"))
            itmRecord.SubItems(1) = .Fields("FirstName")
            .MoveNext
        Loop
    End With

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