Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListView with Icons

Status
Not open for further replies.

TorrediPisa

Programmer
Apr 15, 2004
67
IT
Good Morning

Say you have a Table like This:
EMPLOYEES
Name text 50 chars
Surname text 50 chars
Photo ole
I would like to use the listview to show a list of the employees as follows:
Photo Surname Name

I have coded as:
Dim db As Database
Dim rs As Recordset
Dim strSQL As String
Dim ItmX As ListItem
Set db = OpenDatabase("DATABASE.MDB")
strSQL = "SELECT * FROM EMPLOYEES
Set rs = db.OpenRecordset(strSQL,dbOpenForwardOnly)
Do Until rs.EOF
Set ItmX = ListView1.ListItems.Add(, , rs!PHOTO)
ItmX.SubItems(1) = rs!NAME
ItmX.SubItems(2) = rs!SURNAME
rs.MoveNext
Loop
I would like the photo appears in the list as an icon.
But of course id doesn't work.
Have you got an idea about?
Thanks for yr help.
Regards
TdP
 
I don't know if the listview control will handle this or not. A quick google search suggests that it won't. If you don't get any answers, you might want to look into using the DataRepeater control. You'd have to know how to create an ActiveX control first. Each line of a DataRepeater control is an ActiveX control that you create. While I may be the only person alive for whom this is true, I have a DataRepeater control in a production application, and it actually works.

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top