Results 1 to 2 of 2
  1. #1
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376

    Key is not unique in collection

    Hello all,



    I am getting an error with the attached file. the database is based on file that was offered in a post from long ago that I thought would make a good starting point. It was a mdb file I converted to a accdb file.
    In the example everything looked good as far as how it worked, however, after I started populated the tables with my data, things stopped working.

    I also have an issue where it more or less works on my work computer but not on my Laptop at home, I get an error immediately upon opening the file that says

    This database is a file that I found on the internet that I thought would work as a starting point for an application at work. I have attached the database so hopefully someone can help me out with it. If you open the form "frmExpandAssembly" , you'll may see the "There is no Object in this control" issue. If you get by that issue then choose KABRSA-12 in the "Pick Assembly" dropdown, enter 1 for the quantity to build, then hit "Expand Parts List", you should get the original error of "Key is not unique in collection error". I cannot get to that point here at home because of the "There is no Object in this control" issue.

    Daves Tree View 2-16-18.zip

    Thanks
    Dave

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,388
    There is no Object in this control
    Reference/Version problem. The version of Windows and the treeview control in the original .mdb version is certainly different than the version that is available in Windows 10 and Office 2010.
    This is an inherent problem with activeX controls.
    I'm using Windows 10 and Access 2016 and I was able to get the treeview to work by deleting the existing control and replacing it with a newer one (available by inserting the ActiveX control available in my Access).
    Be sure to change from the default name to 'tvwPartsList'.
    If you are using different versions of Windows and/or Access in your two computers, I doubt that you will be able to get both to work on the same copy of the program.
    "The Key is not unique" is probably an error in the parts list data. Simpler assemblies work OK.
    You can help track down the cause of the error by commenting out all the "On error go to EH" in the modules, or by not commenting out the line but adding pertinent information to the message box displays in the error routines.
    Having narrowed it down that far, you can continue troubleshooting with breakpoints and single stepping the code.
    Good Luck.
    Last edited by davegri; 02-17-2018 at 02:22 PM. Reason: clarity

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

Similar Threads

  1. Forms collection vs. AllForms collection
    By Access_Novice in forum Programming
    Replies: 1
    Last Post: 01-03-2016, 12:30 AM
  2. Replies: 22
    Last Post: 03-03-2013, 02:00 PM
  3. Replies: 3
    Last Post: 11-16-2012, 10:15 AM
  4. Unique queries - Unique Count
    By bigfish in forum Queries
    Replies: 7
    Last Post: 03-14-2012, 01:28 PM
  5. Data collection
    By ROB in forum Access
    Replies: 2
    Last Post: 11-06-2010, 04:18 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