Results 1 to 7 of 7
  1. #1
    jcjaecraw is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    4

    using autonumber to create id numbers specific to table


    I am a new user of Access and i am creating the tables I need for my db. I would like to know if there is a way to create specific table ids for each row of data. Example two tables exist in db Table AB and Table CD. Is there a way to set up autonumber that creates ID numbers with a prefix that is a constant for the individual table? Table AB ID's should read AB1, AB2, AB3, etc. Table CD ID's should read CD1, CD2, CD3, etc.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    That is a custom unique ID and requires code.

    Are these tables identical in structure? If so, why separate tables?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    jcjaecraw is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    4
    Yes the tables are almost identical in structure. There are two different tales because although the information is virtually the same, the groups represented are different in how they use the data in the db. Taking your question a step further, I think i see what you may getting at. Sorry I am new at design. If i were to use one table and provide a field that identifies the user as one group or the other i would still have reular autonumber id's but the db would still be able to differentiate because of the specific group field. Is that about the gist of what your question implied?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Yes, that is exactly it. Have another field in table for the GroupID or GroupCode or whatever you want to call it. Use it as filter criteria.

    What are the differences? A couple of fields would apply to only one of the groups meaning a bunch of blank cells in the table? Either tolerate them or have a child table for this specialized data. It is a balancing act between normalization and ease of data entry/output.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    jcjaecraw is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    4
    Are you saying that after creating a field that identifies the specific group, I can then create an additional field that autonumbers only when that specific group is chosen? It seems to me that I would have to create additional tables that populate with the group data and then create specific numbers for the entries in to the new tables. I believe that my problem is actually corrected with your original information; using a single table for all data entries related to the group users. I would then be able to create my forms using the same information as is in the table. I would also be able to filter and query based on those data fields.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    No, hope I wasn't saying that. The GroupID or GroupCode would be a user entry field. You describe two tables so there are two groups. The values in this field could be 1 or 2 or A or B or a longer descriptor that identifies the group.

    I was also asking about other data that might pertain to only a specific group, as you said the tables were 'almost identical in structure'.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    jcjaecraw is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    4
    OK No problem. I want to thank you very much for your help and insight. It was nice of you to take the time to answer my post. Be well.

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

Similar Threads

  1. Replies: 7
    Last Post: 04-17-2012, 08:17 AM
  2. Replies: 30
    Last Post: 01-16-2012, 05:49 PM
  3. CREATE TABLE and AutoNumber fields
    By JTeagle in forum Queries
    Replies: 1
    Last Post: 11-10-2011, 03:31 AM
  4. Using AutoNumber to issue specific numbers
    By capnpat in forum Access
    Replies: 8
    Last Post: 04-13-2011, 03:57 PM
  5. Replies: 11
    Last Post: 12-04-2010, 10:20 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