Hi all
i am new to the forum and am really hoping that someone can help me with a problem that has been driving me nuts for two weeks now!
I am trying to make a little app with vb.net with an access database backend.
I have a form with a datagridview showing customers. When a user double clicks a row a new form opens with details of the selected customer.
In this form the user can edit details and then save.
Upon saving I have written the code to update the datagridview in the first form.
This is working fine, but ONLY if the datagridview form is set as the Startup form of my application. I have no idea why this is????
Here is the code to save my edit details form and update my datagridview form
This is the code to open the edit details form
If the datagridview form is not set as the Startup form I have to close it and then reopen it for it to show the changes that I have made in the edit form.
Any help/ideas/suggestions greatly appreciated!!!
i am new to the forum and am really hoping that someone can help me with a problem that has been driving me nuts for two weeks now!
I am trying to make a little app with vb.net with an access database backend.
I have a form with a datagridview showing customers. When a user double clicks a row a new form opens with details of the selected customer.
In this form the user can edit details and then save.
Upon saving I have written the code to update the datagridview in the first form.
This is working fine, but ONLY if the datagridview form is set as the Startup form of my application. I have no idea why this is????
Here is the code to save my edit details form and update my datagridview form
VB.NET:
Private Sub btnSaveandClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveandClose.Click
Me.Validate()
Me.TblCustBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.JamestestDataSet)
DGVForm.TblCustTableAdapter.Fill(DGVForm.JamestestDataSet.tblCust)
Me.Close()
End Sub
This is the code to open the edit details form
VB.NET:
Private Sub TblCustDataGridView_CellDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles TblCustDataGridView.CellDoubleClick
Dim F2 As New Form2()
F2.Show()
F2.TblCustBindingSource.Position = Me.TblCustBindingSource.Position
End Sub
If the datagridview form is not set as the Startup form I have to close it and then reopen it for it to show the changes that I have made in the edit form.
Any help/ideas/suggestions greatly appreciated!!!