Hello, my code is not transferring the selected row data into the targeted text boxes on the other form when i click or select the row, i need help here , that the code
Private Sub DataGridView2_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView2.CellContentClick
If Me.DataGridView2.CurrentRow.Selected = True Then
With Form20
.txtSup_Name.Text = ""
.txtSup_Phone.Text = ""
.txtSup_Address.Text = ""
End With
Dim i As Integer
i = DataGridView2.CurrentRow.Index
With Form20
.txtSup_Name.Text = DataGridView2.Item(1, i).Value
.txtSup_Phone.Text = DataGridView2.Item(2, i).Value
.txtSup_Address.Text = DataGridView2.Item(3, i).Value
End With
End If
Me.Close()