Re: Making an autonumber field start at a set number



"RASTUS" <rcuf@xxxxxxxxxxx> wrote

I am constructing an order number and a Job number based database and I
want
the order numbers to automatically increment to the next number, I
currently
have used a combined key to achieve this but don't know how to make both
parts of the key display on the form and don't know how to make the number
increment starting from a given number say 550000, can anyone help,
possibly
I should not use the key field to achieve the desired effect?

You should not use an Autonumber with the anticipation that it will always
increment monotonically as you normally see. There are a number of
situations when that will not be so. The intent of Autonumbers is that they
be unique, not in a particular sequence, so the best advice you can get is
to use autonumbers for identifying records in tables -- internally in your
database, but not ever displaying them to the users -- and to create your
own identifying number about which you have particular expectations or
requirements about the value.

In this regard, the DMax domain aggregate function is useful, and possibly
use of Access Transactions. Searching the archives of this and other Access
newsgroups at http://groups.google.com with various related search words
should give you enough information to start.

Larry Linson
Microsoft Access MVP


.



Relevant Pages

  • Re: autonumber
    ... If you need to work with autonumbers, then check next links how to do this properly. ... There is no reason to create variables to increment this value and it is not reliable way. ... Dim toadd As String ...
    (microsoft.public.vb.database.ado)
  • RE: Autonumbering Primary Keys
    ... Try a groups search for "increment number ... primary key" or "increment autonumber" or "simulated autonumber" or something ... > Access suggests that I have a separate column for OrderID using Autonumbers. ...
    (microsoft.public.access.gettingstarted)
  • Re: Set Autonumber
    ... Thanks for your response - given your caution, what is the best way then to ... have a field that will increment by one for each records? ... The general use of AutoNumbers involves ...
    (microsoft.public.access.tablesdbdesign)
  • Re: How to retrieve id of last inserted record in Access without using @@identity?
    ... I am using Increment and not Random. ... >> highest ID if you are using autonumbers. ... but not necessarily if the NewValues property is set to Random. ... Prev by Date: ...
    (microsoft.public.access.queries)