Problem with auto number field inserting a record

I have a table with an auto number as the primary key.  The first ID in the table is 5069.

I have a vba function to add a new record to the table, using addnew and update.  The function does not include a value for the ID field.  

When I run the function, the ID of the appended record is 50.  

How do I make the ID the next sequential number in the table?

Thanks in advance.
Clive BeatonAccess DeveloperAsked:
Who is Participating?
 
hnasrConnect With a Mentor Commented:
If you delete last records, then Compact and repair database, it restarts from last value of autonumber+1.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Is the AutoNumber the 'ID' you are referring to ?
And if so, as you saying it goes from  5069 to  50 ?
If So. what is before 5069 ? Are they sequential ?

mx
0
 
Clive BeatonAccess DeveloperAuthor Commented:
The auto number is the ID I'm referring to.
If I look at the table in ID sequence, the first record ID is 50, second record ID 5069, and the rest of the records follow on sequentially from 5069.
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Did you delete a bunch of records at some point ?
0
 
Clive BeatonAccess DeveloperAuthor Commented:
Yes.
0
 
Clive BeatonAccess DeveloperAuthor Commented:
Perfect, thank you.  Why didn't I think of that???
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Sorry ... I had to leave work. hnasr beat me to the solution.
0
 
Clive BeatonAccess DeveloperAuthor Commented:
Sorry about that.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.