Results 1 to 3 of 3
  1. #1
    Akchayan is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Aug 2022
    Posts
    102

    Automatic enumeration in a table

    I have a table in which I have the field Position, this field Position should number itself automatically from the number 11. So 11 then 12, 13, etc.
    How do I do that exactly?

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    I would run code on the form to find the DMax of that field and add 1. You might be able to use a macro to do that, but I don't use them so I don't know. The right moment to do that depends on factors such as whether or not it is a multi-user db or if the numbers must be consecutive. In those cases you don't want userB to start after you but finish first then end up with the same 2 numbers (or your record save raises an error if you make this field unique). Nor would you want cancellation to cause numbers to be skipped. We'd have to know more about the situation in order to provide more focused answers.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Quote Originally Posted by Akchayan View Post
    I have a table in which I have the field Position, this field Position should number itself automatically from the number 11. So 11 then 12, 13, etc.
    How do I do that exactly?
    I don'tbunderstand. What do you mean by "field Position"?
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Please reply to this thread with any new information or opinions.

Similar Threads

  1. List / Array / Collection Acting like Enumeration
    By RMittelman in forum Programming
    Replies: 1
    Last Post: 06-05-2019, 11:21 AM
  2. Creating New Table with Automatic Relationships?
    By bobbito in forum Programming
    Replies: 8
    Last Post: 05-10-2016, 01:58 PM
  3. Replies: 3
    Last Post: 06-20-2014, 07:31 AM
  4. Automatic calculation of table field (A2003)
    By GraeagleBill in forum Programming
    Replies: 9
    Last Post: 04-20-2013, 12:06 PM
  5. Automatic Calculation in table
    By musicalogist in forum Access
    Replies: 4
    Last Post: 04-22-2010, 11:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums