Results 1 to 3 of 3
  1. #1
    SFGiants21256 is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    4

    Unique Value of three variables combined

    Hello,

    I'm trying to create a unique ID for a database and am running into a roadblock. I have three variables: group, unit and accountability number. Each of the variables can be repeated but they cannot be repeated when all put together.

    Here is an example:

    Groups: Alpha, Bravo, Charlie
    Unit: Delta, Echo, Foxtrot
    Accountability Number: 1,2,3,4,5

    AlphaDelta1
    AlphaDelta2
    AlphaDelta3
    AlphaEcho1
    AlphaEcho2
    AlphaEcho4
    CharlieFoxtrot1
    CharlieFoxtrot2
    CharlieFoxtrot3
    CharlieDelta1
    CharlieDelta2
    CharlieDelta3
    CharlieDelta4
    CharlieDelta5
    AlphaEcho4 (this is repeated and should be rejected)




    You can see from the example all the individual groups, units, and accountability numbers can be repeated but not when combined.

    If anyone can provide some assistance it would be greatly appreciated.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    In your table, create an update query to fill in the [fey] field

    update table set [key] = [group] & [unit] & [accountability]
    run this query.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Create a primary key (by definition it is unique)

    of the combination Groups,Unit and accountability. No NULLS allowed.

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

Similar Threads

  1. Combined Contributions
    By ZD8062 in forum Access
    Replies: 1
    Last Post: 03-13-2015, 11:37 AM
  2. Replies: 22
    Last Post: 03-03-2013, 02:00 PM
  3. Combined Tables
    By Jerseynjphillypa in forum Queries
    Replies: 10
    Last Post: 05-07-2012, 12:58 PM
  4. Combined Reports
    By baum12 in forum Reports
    Replies: 1
    Last Post: 05-05-2011, 03:19 AM
  5. Combined Fields as Memo
    By Duval in forum Queries
    Replies: 11
    Last Post: 09-13-2010, 08:56 PM

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