1) What are the actual field names in the table
2) If ending number is always starting number + 49 (you said diff of 50 but your table shows 49) then I don't see a need to store the ending number in the table.
3) what do these fields actually represent in the real world?
Here's preliminary code to get you started:
Code:
Public Sub AddBooks()
On Error GoTo ErrHandler_AddBooks
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim i As Integer
Dim qry As String
Dim book_num As Long
Dim starting_num As Long
'STEP 1) find the last book number and starting number in the table
'------------------------------------------------------------------
Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT TOP 1 Booknr, Startingnr FROM tbl_books ORDER BY Booknr DESC;") 'find the record with the highest book nr and return it aswell as it's starting nr
If Not (rs.BOF And rs.EOF) Then
'Query found some records
book_num = rs!Booknr
starting_num = rs!Startingnr
Else
'Query didn't find anything
book_num = 1000
starting_num = 1951
End If
rs.Close
'STEP 2) loop 1000x and insert new records
'------------------------------------------------------------------
For i = 1 To 1000
book_num = book_num + 1
starting_num = starting_num + 50
qry = "INSERT INTO tbl_books (Booknr, Startingnr, Endingnr) VALUES (" & book_num & ", " & starting_num & ", " & starting_num + 49 & ");"
db.Execute qry, dbFailOnError
Next i
ExitHandler_AddBooks:
Set rs = Nothing
Set db = Nothing
Exit Sub
ErrHandler_AddBooks:
MsgBox Err.Description, vbInformation, "AddBooks: Error #" & Err.Number
Resume ExitHandler_AddBooks
End Sub