Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    May 2004
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access 2000 Autonumber

    I have an autonumber field that i would like the numbering to start with 100. This is not a problem, <img src=/S/drop.gif border=0 alt=drop width=23 height=23> but I have probally 30 different products and would like each product to start with 100. Right now I have a combo box that selects that product numbers and an autonumber field for the serial number. Is there any way that for each different product that is selected via the combo box that the autonumber field would start each product with serial# 100 and for each time a user selects the same product the number will increment by 1.

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Access 2000 Autonumber

    You won't be able to do this with a real autonumber field. Instead you will need to use a plain number field (longinteger) and use code to do what you want.

    <post#=379808>post 379808</post#> is similar, and will point you in the right direction, although the situation is not identical.
    Regards
    John



  3. #3
    Star Lounger
    Join Date
    May 2004
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access 2000 Autonumber

    Thanks for replying it is very much appreciated. But I was wondering if there is anyway to have the autonumber reset to 100 by selecting a different product in a combo box and when that same product is selected again that the autonumber field will then increment by 1

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access 2000 Autonumber

    An autonumber field can only contain unique numbers. It should only be used for ID's. You can't guarantee that the sequence will be continuous. If you create a new record, and decide to abort the entry, the new created autonumber will be gone and never be available again.
    The only solution to you problem is to create your numbering by code. See the link John provide in his post for an idea how to create them.
    Francois

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •