Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Serial Numbering

    I have a form on a database, which has a Serial No control, which is autonumber. We are in a situation at the moment, where we are using two manufacturing systems, a sort of crossover period. Because the database is linked to only one system, I am changing the Serial No, from Autonumber, to Number, and using code to increment the number, which also allows the user to type a number in, if necessary. The problem is, the Serial No on the new system, is alphanumeric, e.g S25/1-9. What I would like to do is, for the Serial Number to increment, as normal, but allow the user to type in text, if necessary. So, say the Serial No was 12345, and the next one 12346, the user could type in S25/1-9, for the next one, but on creating a new one, it would be 12347.I don't know if this can be done at all, but I thought I'd ask.

  2. #2
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    You can't do that while using an Autonumber field. To have something like that, you'd need to use a text field, with the current value being generated by custom code.

  3. #3
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I already know how to get sequential numbers without autonumber, but I've never done it using a text field.

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    I think you will have to choose the approach of storing the next numeric serial number either globally or in a table, and then when the user adds a record, test the field before it is saved. If it is the same number you have stored, then increment the number, but if it is not then do not increment the number. A rather clumsy approach, but I don't see an alternative.
    Wendell

Posting Permissions

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