Results 1 to 4 of 4
  1. #1
    swb31763 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2014
    Posts
    2

    Preventing duplicate selection of combo box values

    I am working on a database to track IT assets with third parties. I have a table called ‘Equipment’ that includes info like model, serial numbers, purchase price, date, location, and ‘Asset ID’. I have a second, single field table called ‘asset tag’ that is just a list of asset ID tags, ‘XYZ1000’, XYZ1001’, ‘XYZ1002’…..


    I created a one to one relationship between the two tables on the following fields: ‘equipment.assetID’ and ‘asset tag.asset ID’


    Once an ‘asset ID’ is used, I would like it to either be grayed out or disappear from the list of available ID tags. Basically, I want it so that each ‘asset tag. Asset ID’ can only be used once.



    thanks for any information or recommendations
    swb31763



  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    You save assetID into Tag table? Why not the tag into Equipment table?

    Not sure the tag table is even needed. Next available tag can be determined by searching for the last used tag in Equipment table. That's how I manage generation of unique identifier. What do you want to do when you reach 9999 assets?
    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
    swb31763 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2014
    Posts
    2

    preventing duplicate selection of combo box values

    Quote Originally Posted by June7 View Post
    You save assetID into Tag table? Why not the tag into Equipment table?

    Not sure the tag table is even needed. Next available tag can be determined by searching for the last used tag in Equipment table. That's how I manage generation of unique identifier. What do you want to do when you reach 9999 assets?
    I have a duplicate selection problem figured out, simply indexed the field without duplicates

    I use the asset tag table as a combo box lookup.

    shouldn't have to worry about going over 9999 items

    the more I work on this and research, there should be a way to create a filter or query to strip out the previously used asset tags when listing a new piece of equipment.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    If the number is programmatically generated, there is no need for combobox to select next ID

    As comparison, in my db I programmatically assign an ID to each sample submitted to our lab. This ID is unique in the SampleLogin table in the form of yyyyA-####. I do not have a separate table of just the sample IDs.

    However, for what you want, create a query that joins the two tables on the tag fields. Join type "Include all records from Tags and only those from Equipment that match". Use filter criteria: Equipment.Tag Is Null
    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.

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

Similar Threads

  1. Replies: 3
    Last Post: 07-03-2013, 10:38 AM
  2. Replies: 15
    Last Post: 03-17-2013, 07:40 PM
  3. Preventing other values in combo box
    By cheese9799 in forum Forms
    Replies: 3
    Last Post: 02-14-2011, 03:31 PM
  4. Replies: 1
    Last Post: 08-26-2009, 10:45 AM
  5. Replies: 3
    Last Post: 02-26-2009, 10:17 AM

Tags for this Thread

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