hi mendhak!
VB Code:
Private Sub btnDel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDel.Click Dim i As String Dim dr As DataRow Dim cmd As String Dim cbuild As System.Data.OleDb.OleDbCommandBuilder Try BindingContext(ds, "QuoteDoc").RemoveAt(BindingContext(ds, "QuoteDoc").Position) cbuild = New System.Data.OleDb.OleDbCommandBuilder(daDoc) daDoc.DeleteCommand = cbuild.GetDeleteCommand daDoc.Update(ds, "QuoteDoc") BindingContext(ds, "QuoteTran").RemoveAt(BindingContext(ds, "QuoteTran").Position) ds.Tables("QuoteTran").Rows(0).Delete() Me.BindingContext(ds, "QuoteTran").EndCurrentEdit() cbuild = New System.Data.OleDb.OleDbCommandBuilder(daTran) daTran.DeleteCommand = cbuild.GetDeleteCommand daTran.Update(ds, "QuoteTran") MsgBox("Record deleted.", MsgBoxStyle.OKOnly, "Delete") Catch ex As Exception End Try End Sub
If you can remember, you helped me on this and told you it's working already but to my surprise, it deletes the first record of my database.
This only happens upon loading then I go straight to my Find button then navigate through my First,Next,Previous and Last buttons but if from saving a new record it works fine.
I hope I did not confuse you.
If it's not too much to ask and if you're just interested, please take a look at my program that I attached here. I'm very much willing to accept suggestions and recommendations from all of you!




Reply With Quote