[code=vb]
Private Sub Form_Load()
ListView1.Refre sh
ListView2.Refre sh
ListView1.View = lvwReport
ListView2.View = lvwReport
ListView1.Colum nHeaders.Add , , "ID"
'ListView1.Colu mnHeaders.Add , , "NAME"
ListView2.Colum nHeaders.Add , , "DATE"
ListView2.Refre sh
rs.Open "select distinct id from saldetail", conn, adOpenStatic, adLockOptimisti c
ListView1.Refre sh
While Not rs.EOF
With ListView1
Set lvitem = ListView1.ListI tems.Add(, , rs!id)
'rs1.Open "select * from empdetail where id = '" & ListView1.ListI temsItem & "'", conn, adOpenStatic, adLockOptimisti c
'lvitem.SubItem s(1) = rs1!Name
End With
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
ListView1.Refre sh
ListView2.Refre sh
end sub
[/code]
the above code is to retrieve id from a table saldetail,where i have to retrieve the corresponding names of the ids from another table,is it possible in alist view control???
where i have gone wrong???
please help
Private Sub Form_Load()
ListView1.Refre sh
ListView2.Refre sh
ListView1.View = lvwReport
ListView2.View = lvwReport
ListView1.Colum nHeaders.Add , , "ID"
'ListView1.Colu mnHeaders.Add , , "NAME"
ListView2.Colum nHeaders.Add , , "DATE"
ListView2.Refre sh
rs.Open "select distinct id from saldetail", conn, adOpenStatic, adLockOptimisti c
ListView1.Refre sh
While Not rs.EOF
With ListView1
Set lvitem = ListView1.ListI tems.Add(, , rs!id)
'rs1.Open "select * from empdetail where id = '" & ListView1.ListI temsItem & "'", conn, adOpenStatic, adLockOptimisti c
'lvitem.SubItem s(1) = rs1!Name
End With
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
ListView1.Refre sh
ListView2.Refre sh
end sub
[/code]
the above code is to retrieve id from a table saldetail,where i have to retrieve the corresponding names of the ids from another table,is it possible in alist view control???
where i have gone wrong???
please help
Comment