HELP PLZ: record deleted, cant get that auto# back

  • Thread starter Thread starter reservedbcreater
  • Start date Start date
R

reservedbcreater

i have an autonumberfield for questionid
i screwed up on #47 on a different field (question text) so i just deleted
the record
now when i try to do it again it skips 47 and autonumbers the record 48.

help?????????
 
reservedbcreater said:
i have an autonumberfield for questionid
i screwed up on #47 on a different field (question text) so i just
deleted the record
now when i try to do it again it skips 47 and autonumbers the record
48.

help?????????

Why do you care? Autonumbers exist for the sole purpose of generating a
unique key for a record. The value of an autonumber should never be
used to mean anything. Autonumbers, by their very nature, will develop
gaps in the
sequence whenever a record is deleted, or when a user begins to create a
new record and then decides not to save it.

Most often, autonumbers shouldn't be shown to the users at all (though I
have been known to do it, just to give the users a handle to identify a
record that wasn't otherwise easy to single out). But if you care
whether the autonumbers have gaps, then you are already assigning them
more meaning than you ought.

If your application requires a sequential question number, then you
should use some other mechanism to generate those numbers so that no
gaps will develop. There are various schemes for doing that, from
simple ones that only work for a single-user database, to more complex
ones that can be safely used when multiple users will be adding records
to the table. A Google Groups search will doubtless turn these up.
 
Hi.

The Autonumber is not guaranteed to be sequential, so if you need a field
value incremented by a value of exactly one for each new record created --
without any gaps -- then you shouldn't be using an Autonumber for the
field's data type, because one shouldn't assign an Autonumber to a field
that has meaning. If you need this field to mean something, then create a
user-defined method to assign and maintain sequencial numbers for each
record.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as
"Answers," so that all may benefit by filtering on "Answered questions" and
quickly finding the right answers to similar questions. (Only "Answers"
have green check-marks.) Remember that the best answers are often given to
those who have a history of rewarding the contributors who have taken the
time to answer questions correctly.
 
thanky ou, the auto numbers dont have a meanign i dont think anyway??? they
are primary keys in some cases? but they dont need to be shown
no.........but in this case they were question #'s....just seems od
question 46 then 48 for no apparent reason.....but it doesnt mean nothing
so.....thank you for this response....i can continue knowing it is ok.
 

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

Back
Top