Re: ACCESS: Can I make Autonumber field start with 582 rather than

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Feb 17, 4:57 pm, "tina" <nos...@xxxxxxxxxxx> wrote:
did you database? it doesn't use an Autonumber field,
but rather a Long Integer field. the point of the code, and the example, is
to assign a sequential number programmatically so the user doesn't have to
do it manually.

Did you read what I wrote? Here's a précis: MAX + INCREMENT isn't a
reliable algorithm for generating Sequence numbers.

I did indeed look at the example application. Not at the code but I
did try out the application after I'd inserted a very high value into
the 'long integer' column it did indeed return 'error' rather than a
sequential number. Note the OP used the term 'autonumber' in the
subject of this thread so it is reasonable to point out that the
algorithm used in the suggested example application differs from that
of Access/Jet's autonumber functionality.

Did you try my code? If you did, you should have observed how
autonumber works i.e. when MAX + INCREMENT goes out of the value range
of 'long integer', rather than error it 'wraps'.

A better approach in SQL is to have a ready-rolled table of
incrementing integers, a standard trick in SQL (do a google search for
"Sequence table"). It is more reliable to have a permanent auxiliary
table rather than generate sequence numbers on the fly e.g. outer JOIN
the Sequence table and find the minimum unused value.

Jamie

--


.



Relevant Pages

  • Re: Making an autonumber field start at a set number
    ... the order numbers to automatically increment to the next number, ... I like autonumber for table keys. ... It is so easy to get out of sequence and have holes using autonumbers. ...
    (comp.databases.ms-access)
  • Re: Order of evaluation of function arguments
    ... it schedules an increment of "i", ... also will occur by the next sequence point, ... The order of evaluation of the function designator, ... int f, g, h; ...
    (comp.lang.c)
  • Re: Is this a bug of the compiler?
    ... is done: the increment. ... Since your post has now triggered the sequence point, ... store result from 4) to i ... call function foo ...
    (comp.lang.cpp)
  • Re: need help on sequence number between related form and subform
    ... mainform, it is an autonumber on the mainform, and I don't want to edit it on ... I simply want to increment the sequence ID as detail items are ... I may have package 34 with 4 inventory items added. ... will have a pkg_id value of 34, and the pkg_dtl_seq value will increment from ...
    (microsoft.public.access.modulesdaovba)
  • Re: need help on sequence number between related form and subform
    ... mainform, it is an autonumber on the mainform, and I don't want to edit it on ... I simply want to increment the sequence ID as detail items are ... I may have package 34 with 4 inventory items added. ... will have a pkg_id value of 34, and the pkg_dtl_seq value will increment from ...
    (microsoft.public.access.modulesdaovba)