I am using VS 2010 (Visual basic) and MS Access 2004 (mdb)
Everytime i run the program and add new records, when the autonumber back to negative one (-1), I got error like this

I try different insert codes but its not working, some of the codes I tried is not saving the record in the database..
Here is my code:
ADD NEW BUTTON:
SAVE RECORD BUTTON:
Everytime i run the program and add new records, when the autonumber back to negative one (-1), I got error like this

I try different insert codes but its not working, some of the codes I tried is not saving the record in the database..
Here is my code:
ADD NEW BUTTON:
VB.NET:
VB.NET:
Private Sub btn_add_3rd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_add_3rd.Click
Me.X_subjects_3rdBindingSource.AddNew()
SubnameTextBox2.Clear()
DescTextBox2.Clear()
Unit_noTextBox2.Clear()
Unit_priceTextBox2.Clear()
End Sub
SAVE RECORD BUTTON:
VB.NET:
VB.NET:
Private Sub btn_save_3rd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_save_3rd.Click
Dim Mycn As New OleDbConnection
Dim Command As OleDbCommand
Dim icount As Integer
Dim SQLstr As String
Try
Mycn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\mydbv1.mdb")
Mycn.Open()
SQLstr = "INSERT INTO x_subjects_3rd VALUES('" & IDTextBox3.Text & "','" & SubnameTextBox2.Text & "','" & DescTextBox2.Text & "','" & LaboratoryComboBox2.Text & "','" & Unit_noTextBox2.Text & "','" & Unit_priceTextBox2.Text & "','" & SchedComboBox2.Text & "')"
Command = New OleDbCommand(SQLstr, Mycn)
icount = Command.ExecuteNonQuery
MsgBox("Record has been added to the database", MsgBoxStyle.Information, MessageBoxButtons.OK)
Refresh()
Catch ex As Exception
MsgBox(ex.Message)
Mycn.Close()
Exit Sub
End Try
End Sub