Question on KB Article 924741 for Access 2007

A

Anthony Lisanti

I'm just wondering why this wasn't fixed in SP1. it seems like an
annoyance rather then a bug.


Tony
 
B

boblarson

Basically, the real answer lies in the fact that if you even CARE what the
autonumber is then you aren't using it correctly. It should only really be
used to generate a UNIQUE number, which is what it only truly guarantees. It
should never be used for something with meaning UNLESS you can live with the
gaps, don't need it to be incremented by one each time because it can (in
certain uses) jump around and even include negative numbers.

If you need a consecutive incrementing number, create your own using DMax.
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
If my post was helpful to you, please rate the post.
__________________________________
 
G

George Nicholson

Missing from the workarounds in that article is: if you are going to
"design" a table in datasheet view, just create your field names, don't
enter data.
 
S

Sylvain Lafontaine

Feel better now?

When you put a feature somewhere, you put it right. The fact that an user
won't care or shouldn't care about the sequencing of autogenerated numbers
change nothing to the fact that this feature has been built for newbies and
as such, it must behave the way any user and in particular a newbie is
expecting it to behave. Clearly, its actual behavior is pretty annoying to
the point of beeing recognised as a problem and as such, it should have been
corrected in SP1.

The capability of adding a new field to a table in datasheet view is a
feature and like any other feature, it should be done right. If it's not,
then it should be corrected in order to be right.
 
A

Anthony Lisanti

Well, when your just learning access for your job, you might HAVE
QUESTIONS like that. I'm just hitting chapter 2 in one of MS training
books when it mentions this bug.

So, before blasting someone for using something wrong, find out the
situation first, OK?
 
B

boblarson

just because it says it in the book doesn't mean they might not have it
wrong. And, I was not attempting to BLAST anyone. I was trying to explain,
with furvor, that which most people do not know or understand that an
autonumber is not good for human consumption.


--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
If my post was helpful to you, please rate the post.
__________________________________
 
D

david

It's kind of difficult to 'fix' since it's a fundamental characteristic
of Access. If there are enough complaints, the work around
will have to be to build something completely separate from
Access, and then build something to copy the table from
the separate thing into Access.

Or else to get rid of Access and sell something different with the
same name.

You might think that they could just modify the Autonumber
behaviour somehow, but you would be wrong. They tried to
modify the Autonumber behaviour for Access 2000, and after
repeated attempts the change is still broken, 8 years later.
KB924741 is not something they can just patch up.

(david)
 
T

Tony Toews [MVP]

david said:
You might think that they could just modify the Autonumber
behaviour somehow, but you would be wrong. They tried to
modify the Autonumber behaviour for Access 2000, and after
repeated attempts the change is still broken, 8 years later.
KB924741 is not something they can just patch up.

The problem in KB924741 is new to Access 2007.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
T

Tony Toews [MVP]

boblarson said:
If you need a consecutive incrementing number, create your own using DMax.

Dmax has it's limitations as well. If there is any time delay
between doing the Dmax and saving the record then someone else could
use the same ID.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
D

david

The problem in KB924741 is new to Access 2007.

The feature is new in Access 2007, but it just exposes a
fundamental characteristic of Access Autonumbers: if you
request a new record, you increment the autonumber count.

I don't see a quick fix for that behaviour: they will need to
re-write the wizard.

(david)
 
G

George Nicholson

a fundamental characteristic of Access Autonumbers: if you
request a new record, you increment the autonumber count.

Yes, but KB924741 isn't requesting a new record. If you are *creating* a
table in *datasheet* view and *add data* to 2 fields to the 1st record, the
autonumber for the 2nd record will be 3, not 2. If you *add data* to 4
fields in the fist record, the autonumber for the 2nd record will be 5. etc,
etc.

None of which changes anything about the general discussions of autonumbers,
but the behaviour is new.

--
HTH,
George
 
D

david

You aren't requesting a new record,

but the wizard is.

I don't see a quick fix for that behaviour: they will need to
re-write the wizard to use a temporary structure instead of
an Access table.

(david)
 
T

Tony Toews [MVP]

david said:
You aren't requesting a new record,

but the wizard is.

No the wizard is not requesting a new record for each new field you
create. Or rather it is but it certainly shouldn't be.

BTW have you actually tried this to see what behavior we're talking
about?
I don't see a quick fix for that behaviour: they will need to
re-write the wizard to use a temporary structure instead of
an Access table.

To me it's just a bug in the wizard code.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
T

Tony Toews [MVP]

david said:
The feature is new in Access 2007, but it just exposes a
fundamental characteristic of Access Autonumbers: if you
request a new record, you increment the autonumber count.

Not quite. You have to see it yourself to understand what is going
on. Hmm, if you don't have A2007 I could do a Camtasia movie.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
D

david

BTW have you actually tried this to see what behavior we're
talking about?

You add a field to the table and the autonumber increments.
What else is there to see?
create. Or rather it is but it certainly shouldn't be.
To me it's just a bug in the wizard code.

But that's what always happens when you refresh the data into
an empty record. There's not a 'line of code' that says 'increment
the autonumber field'. It's not a coding error: it's an early design
decision to use an Access-like form tied to an Access table. To
fix it you have to throw out the design of the wizard, or do other
unpalatible things like saving the data early, which looses the edit-undo,
and means the wizard behaviour would still be unlike that expected
in Access.

Or perhaps add code to automatically re-set the autonumber to 1
after every design change? That would be a brave decision, not
one I would take lightly.

Or use an unbound form and store the input data elsewhere?
That's where I came in.

(david)
 
T

Tony Toews [MVP]

david said:
You add a field to the table and the autonumber increments.
What else is there to see?

Ok, good.
But that's what always happens when you refresh the data into
an empty record.

Now you've got me confused. Can you explain how to do this in a
datasheet view? And in, say, A2003?

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Top