I have a form made in ms access and vba. I have this code in an insert with the default given upon creating the button
DoCmd.GoToRecord , , acNewRec My form is bound to a table and linked tables to a SQL database. It successfully added if the table has no records yet but if there is already a record in the table and the form was closed and opened again and add new data again it will no longer insert new rows of record instead it just updates the last record.
After the form is called I click the new button which clears all the textbox value and then input a new record and click add, what happened was, it will just update the last record. and I have an auto increment id. Anyone experiencing this one?
the code on my add button is this
Private Sub btnAdd_Click() On Error GoTo Err_CustomerNew_Click DoCmd.GoToRecord , , acNewRec Exit_CustomerNew_Click: Exit Sub Err_CustomerNew_Click: MsgBox Err.Description Resume Exit_CustomerNew_Click End Sub
no script is involve only the form is bound to a table linked to sql datbase. and also the recordsource of the form is I'm using the query not table directly. like Select * from tablename order by id desc.