Help Needed With Primary Key

I

iain

When I'm in a table or form and the 'New' record function is activated and
the Primary Key is incremented, even if the record is not saved.

Does anyone know if it is possible to exit a table or form without
incrementing the primary key, if the New record function has been activated?

Thanks for any help or suggestions.
 
B

BruceM

If it is an autonumber primary key, not really. If you do a Compact and
Repair you can eliminate "missing" numbers at the end of the sequence, but
it is not practical to do so as a matter of course. It is so impractical
that you should regard it as impossible. Compact and Repair has its uses,
but this isn't one of them.

However, you can roll your own "autonumber", which will eliminate gaps. One
simple and robust technique here:
http://www.rogersaccesslibrary.com/...?TID=395&SID=e8zaf5b13fb3a8zadz32669zb52a4dc8

The link is all on one line. Another way to get there:
http://www.rogersaccesslibrary.com/forum/forum_topics.asp?FID=1
and look for the AutonumberProblem sample.
 
I

iain

Thank you Bruce,

it is an autonumber. I guess I am just being lazy and trying to make use of
it as a record counter which I know it isn't, so I will have to have to
construct some reports.
 
B

BruceM

Again, the links in my first reply show you a way to add incrementing
numbers (a sort of simulated autonumber that avoids gaps).
 

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