Results 1 to 2 of 2
  1. #1
    Rude Awakening is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Sep 2014
    Posts
    4

    Unique ID creation

    Hi Guys


    New to the forum :-)

    I'm trying to create a user story DB and need a Unique reference as a Field.
    It is currently as a text field, I want it to be in the form of [Field1] & “-” & [Field2] & “[Autonumber]”
    I need the autonumber to index IF Field1 and Field2 match. and if not to restart at 1.
    Can this be done?

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    No, I don't think so. An autonumber is just that, "auto". It is incremented as soon as a new record is inserted into the table, which happens as soon as any data is entered into the record, and the number cannot be changed once it is generated.

    The only way to reset it to 1 is to delete all data from the table, and then do a compact and repair.

    You will have to use a numeric integer field, combined with a little VBA code to accomplish what you want to do.

    John

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

Similar Threads

  1. Help me wit this database creation
    By vijay in forum Reports
    Replies: 2
    Last Post: 05-09-2014, 11:25 PM
  2. Replies: 8
    Last Post: 07-18-2013, 01:52 PM
  3. Replies: 22
    Last Post: 03-03-2013, 02:00 PM
  4. Unique queries - Unique Count
    By bigfish in forum Queries
    Replies: 7
    Last Post: 03-14-2012, 01:28 PM
  5. MDE Creation problem
    By bbylls in forum Access
    Replies: 24
    Last Post: 01-01-2010, 10:55 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