I have a database file that when I click on the "ADD" button should allow me to add a record to the end of the database. The problem is that it DOES add the record, however it also overwrites whatever record I am currently own. So I have two identical records and one missing. It appears that I need some code to go to the end (empty) part of the database or some code that will not overwrite whatever record I am own. This is a local MS Access database by the way.

What do I need?

Private Sub btnAdd_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnAdd.Click
'Begin an Add operation or cancel the current operation

If btnAdd.Text = "&Cancel" Then 'Cancel an Add or Edit
LockTextBoxes()
EnableNavigation()
btnSave.Enabled = False
btnAdd.Text = "&Add"
RejectChanges()
mblnAdding = False
Else 'Begin an Add operation

UnlockTextBoxes()
ClearText()
txtAuthor.Focus()
DisableNavigation()
btnSave.Enabled = True
btnAdd.Text = "&Cancel"
lblRecordNumber.Text = ""
mblnAdding = True
End If
End Sub

Private Sub btnSave_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnSave.Click
'Save the new record for an Add or Edit

If mblnAdding Then 'Add in progress
Try
Dim newRow As DataRow = DsBooks1.Books.NewRow
newRow("Author") = txtAuthor.Text
newRow("ISBN") = txtISBN.Text
newRow("Title") = txtTitle.Text
DsBooks1.Books.Rows.Add(newRow)
Catch exc As Exception
MessageBox.Show("Unable to add the record." & _
ControlChars.NewLine & exc.Message, "Books")
End Try
mblnAdding = False
lblRecordNumber.Text = "Record Added at the end of the table"
End If

'Actions to take to complete an Add or an Edit
LockTextBoxes()
EnableNavigation()
btnSave.Enabled = False
btnAdd.Text = "&Add"
mblnIsDirty = True
End Sub