|
tech
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Help Needed With Primary KeyWhen 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. 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/forum/forum_posts.asp?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. Show quoteHide quote "iain" <i***@discussions.microsoft.com> wrote in message news:87B3CBFF-0DCD-49B0-931E-5707EF8F5C66@microsoft.com... > 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. 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. Show quoteHide quote "BruceM" wrote: > 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/forum/forum_posts.asp?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. > > "iain" <i***@discussions.microsoft.com> wrote in message > news:87B3CBFF-0DCD-49B0-931E-5707EF8F5C66@microsoft.com... > > 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. > > > Again, the links in my first reply show you a way to add incrementing
numbers (a sort of simulated autonumber that avoids gaps). Show quoteHide quote "iain" <i***@discussions.microsoft.com> wrote in message news:30E2F138-A418-4E1B-BA54-A8E12C2BC3CA@microsoft.com... > 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. > > "BruceM" wrote: > >> 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/forum/forum_posts.asp?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. >> >> "iain" <i***@discussions.microsoft.com> wrote in message >> news:87B3CBFF-0DCD-49B0-931E-5707EF8F5C66@microsoft.com... >> > 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. >> >> >> |
|||||||||||||||||||||||