I have 2 forms, Form5 and Form4. Form5 has a datagridview with customer info, you double click the row header and that opens up form4, inserts customer info into texboxs on form4
My problem is when you click customer 1 or customer 2 the textboxes always fill with customer1. the following is my code
Code Public Class Form5
Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SqlDataAdapter1.Fill(Dscustomer1, "Customer")
If DataGridView1.Rows.Count = 0 Then
Me.Tag = -1
Me.DialogResult = Windows.Forms.DialogResult.OK
Me.Close()
End If
End Sub
Private Sub btnOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpen.Click
SqlDataAdapter1.Fill(Dscustomer1, "Customer")
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
SqlDataAdapter1.Update(Dscustomer1)
End Sub
Private Sub DataGrid1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs)
Dim MyGrid As DataGrid = DirectCast(sender, DataGrid)
Dim MyForm4 As New UpdateCustomerTypes(Dscustomer1, MyGrid.CurrentCell.RowNumber)
Form4.ShowDialog()
Me.DataGridView1.Refresh()
for Form5
This is the code form4
Public Class Form4
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SqlDataAdapter1.Fill(DsCustomer21, "Customer")
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
SqlDataAdapter2.Update(DsCustomer21, "Customer")
End Sub
End Class
Any help would be apprieciated
Thanks Steve