PDA

Click to See Complete Forum and Search --> : Listviewboxes and ADO


AmmerBow
Oct 2nd, 2000, 04:44 PM
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.


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


Set itmX = LstTasks.ListItems.Add(1, , ??????)
itmX.SubItems(1) = ??????


Can this be done?
Is my thinking off?
Thanks!

Serge
Oct 2nd, 2000, 05:44 PM
Try something like:

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