I am using MS Visual Studio to create a form and Load an MS Access DB. I have made all the connections and am able to access the DB. I created an Add button control. My problem is with the AddNew ADO Recordset.
****** Code *******
Private Sub Add_Click()
adcEmployee.Recordset.AddNew
MsgBox "Record Added"
End Sub
When I ran this it would substitute the current record with the info that was entered on the form instead of creating a new record in the MS Access DB Table.
Then I attempted to run the following:
********** Code ******************
Private Sub Add_Click()
adcEmployee.Recordset.AddNew
adcEmployee.Recordset!Emp_L_Name = Emp_L_Name.Text
adcEmployee.Recordset!Emp_F_Name = Emp_F_Name.Text
adcEmployee.Recordset!Emp_MI = Emp_Middle_Init.Text
adcEmployee.Recordset.Update
MsgBox "Record Added"
End Sub
I got the following error when I went to add it.
Run-time error '-2147217842(80040e4e)';
The change was canceled during notification; no columns are changed.
The DB connections are working, I just need help for the AddNew button.
****** Code *******
Private Sub Add_Click()
adcEmployee.Recordset.AddNew
MsgBox "Record Added"
End Sub
When I ran this it would substitute the current record with the info that was entered on the form instead of creating a new record in the MS Access DB Table.
Then I attempted to run the following:
********** Code ******************
Private Sub Add_Click()
adcEmployee.Recordset.AddNew
adcEmployee.Recordset!Emp_L_Name = Emp_L_Name.Text
adcEmployee.Recordset!Emp_F_Name = Emp_F_Name.Text
adcEmployee.Recordset!Emp_MI = Emp_Middle_Init.Text
adcEmployee.Recordset.Update
MsgBox "Record Added"
End Sub
I got the following error when I went to add it.
Run-time error '-2147217842(80040e4e)';
The change was canceled during notification; no columns are changed.
The DB connections are working, I just need help for the AddNew button.