Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / October 2005

Tip: Looking for answers? Try searching our database.

Primary key

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JackHerrington - 28 Oct 2005 15:11 GMT
I created a simple database in an earlier version of Access, and recently
converted it to Access 2000.  It was set up to automatically increment the
primary key, and got as high as about 400.  Now, in Access 2000 when I try to
add records, the next key it puts in is -32,631, or something like that, then
-32,630, etc.  How do I get it to just continue the primary key numbers, and
not start with this huge negative number?
Signature

Jack

Douglas J Steele - 28 Oct 2005 17:34 GMT
Autonumber fields exist for the sole purpose of providing a (practically
guaranteed) unique value that can be used for a primary
key. -32631, -32630, -32629 fills that purpose just as well as 400, 401,
403.

Autonumbers are really intended for "human consumption": in fact, it's rare
to show the values to the users. If the value of the number is important to
you, you probably shouldn't be using Autonumbers.

Note that if you replicate the database, the Autonumber will change from
sequential to random numbering.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> I created a simple database in an earlier version of Access, and recently
> converted it to Access 2000.  It was set up to automatically increment the
> primary key, and got as high as about 400.  Now, in Access 2000 when I try to
> add records, the next key it puts in is -32,631, or something like that, then
> -32,630, etc.  How do I get it to just continue the primary key numbers, and
> not start with this huge negative number?
BruceM - 28 Oct 2005 17:54 GMT
I expect you mean "really NOT intended for human consumption".

> Autonumber fields exist for the sole purpose of providing a (practically
> guaranteed) unique value that can be used for a primary
[quoted text clipped - 21 lines]
> and
>> not start with this huge negative number?
Douglas J Steele - 28 Oct 2005 20:44 GMT
Oops, yes. Thanks, Bruce!

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> I expect you mean "really NOT intended for human consumption".
>
[quoted text clipped - 23 lines]
> > and
> >> not start with this huge negative number?
JackHerrington - 29 Oct 2005 14:42 GMT
Thanks, Doug.  I understand that.  The reason I would like it to just
continue with the existing sequence is convenience.  I enter new data into
the existing table, and it's less confusing if I can just add to the bottom
of the table, and not have the entries mixed in somewhere.  Is that possible?
Signature

Jack

> Oops, yes. Thanks, Bruce!
>
[quoted text clipped - 28 lines]
> > > and
> > >> not start with this huge negative number?
BruceM - 31 Oct 2005 15:01 GMT
I'll jump back in and say that in general you should really not be entering
data directly into tables.  That's what forms are for.  You can use
datasheet view of a form if you want to emulate the look of a table.  You
can base the form on a query that is sorted as you choose, or you can use
the form's Order By property.  In either case the new record will be added
to the bottom as the form appears on the screen.  The same thing applies to
a table.  If you are making a one-time (or rarely changing) list such as
departments or something of the sort you may decide to just enter the data
directly in a table, but for day-to-day use a form is the best choice.  I
would suggest that if you need to maintain a sequential order for the
records you should probably use something like an automatically incrementing
number (for example, the first record would be 0001, the second 0002, and so
forth), or maybe a date or time stamp.  For reasons already mentioned,
autonumber is not a good choice.

> Thanks, Doug.  I understand that.  The reason I would like it to just
> continue with the existing sequence is convenience.  I enter new data into
[quoted text clipped - 42 lines]
>> > > and
>> > >> not start with this huge negative number?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.