-
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!
-
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