Number Field Resets

A

Asif

I have two fields ID (Autonumber) and PROCESSID (Number). Now every
time I add a new record the ID field jumps by 1 value i.e. if the ID
field shows 23 when a new record is created the ID field will now show
25 (and I haven't a clue why), so what I did was to add a second field
PROCESSID and that store the number sequentially 1,2,3,4. The problem
is that when I create a new record the PROCESSID resets itself back to
0 but I want it to increment as new records are added.

I'm using the following code to increment PROCESSID when new record is
added

Me.PROCESSID = Me.PROCESSID + 1

Thanks
 
A

Al Campagna

Asif,
The reason the autunumber appears to skip is that someone probably opened a new record,
and escaped out before the record was updated to the table... thereby using up that
particular ID value. The next new record used the next ID value

Try using the DMax function to determine the maximum ID, and add 1.
Set the ID Default to...
= NZ(DMax("[ID]", "tblYourTable")) + 1

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top