0

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

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Lusiphur
0

Wow... well first, this is completely in the wrong forum... from the look of things you're looking for either VB.Net or ASP.Net forum.

Second, it would've been great if you'd used the code-tags to surround your code segments above.

Hopefully a moderator will clear all of that up for you and it'll end up in a forum section where it can actually get some attention :)

Edited by mike_2000_17: Fixed formatting

This topic has been dead for over six months. 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.