i search record from the present form then i want to load it in another form
for editing and saving the record. here's my code but its always error.

With list_stud
    .label1.caption = ID_no
    .label2.caption = lvStudentInfo.SelectedItem.SubItems(1)
    .label3.caption = lvStudentInfo.SelectedItem.SubItems(2)
    .label4.caption = lvStudentInfo.SelectedItem.SubItems(3)
    .label5.caption = lvStudentInfo.SelectedItem.SubItems(4)
    .label6.caption = lvStudentInfo.SelectedItem.SubItems(5)
    .Show 1
End With

please help me with this.

Edited 3 Years Ago by vonnoy

the problem is nothing will display. is there something wrong with my code?

I'm assuming lvStudentInfo is the listview on the other form. You have to identify it by the form it's on MyOtherForm.lvStudentInfo

Add the following to your code...

With frmYourSecondFormNameHere
    With list_stud
        .label1.caption = ID_no
        .label2.caption = lvStudentInfo.SelectedItem.SubItems(1)
        .label3.caption = lvStudentInfo.SelectedItem.SubItems(2)
        .label4.caption = lvStudentInfo.SelectedItem.SubItems(3)
        .label5.caption = lvStudentInfo.SelectedItem.SubItems(4)
        .label6.caption = lvStudentInfo.SelectedItem.SubItems(5)

        .Show 1
    End With
End With
This question has already been answered. Start a new discussion instead.