Adding a record using a data entry form

McShmack

Member
Joined
Aug 16, 2011
Messages
7
Programming Experience
Beginner
Hello All,
I have a form that contains a combo box that is used to populate several text boxes on a form based on the selected item. If the item is not in the combo box then I call a data entry form that I use to add the new item to the db. The data entry form contains a button that has the following code;

Private Sub btnSaveExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSaveExit.Click
Me.TblCarriersBindingNavigatorSaveItem.PerformClick()
Dim myForm As Form
myForm = frmRateConfirmtemp1
'my calling form
Me.Close()
myForm.Show()
End Sub

My question is as follows, what is the best way to add and save this new record to the database and return control back to my calling form. I am currently using the PerformClick() method to save the record before closing but it doesnt seem to work. Once in a while it does work but only temporarily, any assistance will be very much a appreciated.
 
Got it had to change the following line of code;

Me.TblCarriersBindingNavigatorSaveItem.PerformClick( )

To

Me.TblCarriersBindingNavigatorSaveItem_Click(Nothing, Nothing)
 
Back
Top