0

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 by vonnoy

3
Contributors
5
Replies
7
Views
4 Years
Discussion Span
Last Post by tinstaafl
0

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

0

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

0

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.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.