Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
frmUpdate.Show()
' What this does is when the User selects a record in the DataGridView
' it will populate the textbox on the other form with the corresponding
' Cell Value.
frmUpdate.txtFirst.Text = dgv1.CurrentRow.Cells(0).Value.ToString
frmUpdate.txtLast.Text = dgv1.CurrentRow.Cells(1).Value.ToString
frmUpdate.txtAddress.Text = dgv1.CurrentRow.Cells(2).Value.ToString
frmUpdate.txtCity.Text = dgv1.CurrentRow.Cells(3).Value.ToString
frmUpdate.txtZip.Text = dgv1.CurrentRow.Cells(4).Value.ToString
frmUpdate.txtPhone.Text = dgv1.CurrentRow.Cells(5).Value.ToString
frmUpdate.txtEmail.Text = dgv1.CurrentRow.Cells(6).Value.ToString
frmUpdate.txtID.Text = dgv1.CurrentRow.Cells(7).Value.ToString
End Sub
mangesh5588 0 Newbie Poster
GeekByChoiCe 152 Practically a Master Poster Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.