Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2011
    Posts
    103

    Unanswered: Sequence Numbering Stops at 10

    Hello, I'm using Access 2010.

    I have code that does something like sequence numbering to give my records unique id designated by the inputs. Here is the code.

    Code:
    Me.UniqueID = Nz(DMax("[UniqueID]", "tbl_Data", "[CenterNb] = " & Me.CenterNb), Me.CenterNb & 0) + 1
    Me.Dirty = False
    The result is something like 10001, 10002, 10011, 10012.

    This works perfect for me until recently. Apparently it's only counting up to 10. What I mean by this is that if CenterNb has more than 10 records it goes up to 100010 and repeats itself. Any know what I am missing? Can someone help me fix this issue?

    Thanks.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    If I had to guess, UniqueID is a text field so Access is making an alphabetic comparison. In that instance, 9 is greater than 10, 100, 1000, etc.
    Paul

  3. #3
    Join Date
    Nov 2011
    Posts
    103
    Oh, so if I change that field to number instead of text would that solve my issue?

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    It would seem simple enough to test, but that's my belief.
    Paul

Posting Permissions

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