Please see the code below :
public da1 As New OleDbDataAdapter()
public dt1 As New DataTable("menuCat")
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim e1 As OleDbException
Dim scmd1 As New OleDbCommand()
scmd1.CommandText = "SELECT catID,catName FROM menuCat"
scmd1.Connection = cn1
da1.SelectCommand = scmd1
Try
cn1.Open()
da1.Fill(dt1)
TextBox1.DataBindings.Add(New Binding("text", dt, "catID"))
TextBox2.DataBindings.Add(New Binding("text", dt3, "catName"))
Catch e1
MsgBox(e1.Message)
End Try
End Sub
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
Me.BindingContext(dt3).Position += 1
End Sub
Private Sub btPre_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btPre.Click
Me.BindingContext(dt3).Position -= 1
End Sub
Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNew.Click
?
?
?
..
..
..
End Sub
Private Sub btnUpd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNew.Click
?
?
?
..
..
..
End Sub
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNew.Click
?
?
?
..
..
..
End Sub
What statements shoud I fill in Sub btnNew_Click ,Sub btnUpd_Click and Sub btnCancel_Click to add ,update and cancel a new record?
Thanks so much!