Quote:
Originally posted by VB-Mike
Chris, thank you for the quick reply. I think I am getting close but still not yet.
Here is what I have in the loop:
If rs_assoc.RecordCount <> 0 Then
While Not rs_assoc.EOF
DoEvents
Set ADDRESSBOOK = ListView.ListItems.Add(, "A" & rs_assoc.AbsolutePosition, rs_assoc.Fields("First Name"))
ADDRESSBOOK.SubItems(1) = rs_assoc.Fields("Last Name")
ADDRESSBOOK.SubItems(2) = rs_assoc.Fields("Address")
ADDRESSBOOK.SubItems(3) = rs_assoc.Fields("City")
ADDRESSBOOK.SubItems(4) = rs_assoc.Fields("State")
ADDRESSBOOK.SubItems(5) = rs_assoc.Fields("Zip")
Set ADDRESSBOOK = Nothing
rs_assoc.MoveNext
Wend
End If
The db connect and rs creation are in a module so all I need is the loop for this sub routine. So if I have a field in my database table called fname and a column header called First Name which I programatically set when the form loads then how do I pull the fields in fname and put them under First Name?
Just change the following line will do.