hi guys,
i have a problem regarding on how to view the image in the database when i select one information in my list view. and change it when i select another.
Public Sub studentList()
Me.ListView1.ListItems.clear
Set rs = New ADODB.Recordset
With rs
.Open "select * from tblStudentProfile", db, 3, 3
While Not .EOF
ListView1.ListItems.Add , , !StudentID
ListView1.ListItems(ListView1.ListItems.Count).SubItems(1) = !StudentLastName + ", " + !StudentFirstName + " " + !StudentMI
ListView1.ListItems(ListView1.ListItems.Count).SubItems(2) = !Age
ListView1.ListItems(ListView1.ListItems.Count).SubItems(3) = !Birthdate
ListView1.ListItems(ListView1.ListItems.Count).SubItems(4) = !HomeAddress
ListView1.ListItems(ListView1.ListItems.Count).SubItems(5) = !ContactNo
ListView1.ListItems(ListView1.ListItems.Count).SubItems(6) = !HSYear
ListView1.ListItems(ListView1.ListItems.Count).SubItems(7) = !HSSection
txtIDpicture.Text = Me.ListView1.SelectedItem.Text
If txtIDpicture.Text = Me.ListView1.SelectedItem.Text Then
Me.CommonDialog1.FileName = !ProfilePicture
Picture1.Picture = LoadPicture(CommonDialog1.FileName)
End If
.MoveNext
Wend
End With
lblTotal.Caption = ListView1.ListItems.Count
Set rs = Nothing
End Sub