Results 1 to 6 of 6
  1. #1
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114

    Can a combo box display results from two unrelated tables


    Here's another short question - Can a combo box display information from two unrelated tables, but that have the same design?

    I have two item number tables and they are both designed the exact same way, i.e. Column 1 = Item Number; Column 2 = Description. I want the combo box to pull from both tables and "add" the second table to the bottom of the first table.

  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,643
    Use a UNION query.

    Why do you have two identical 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
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114
    Thanks.

    I'm building a specification db and one number "rolls up" into the other.

    Level one components are used in level two blends
    Level two blends are used in level three capsules.

    In the first scenario level one is the child and level two is the parent, while in the second scenario level two is the child and level three is the parent. Seems simple enough.

    When I put all the item numbers into the same table I can't enforce referential integrity because the table which links the parent to the child would have two columns with the same name (they have the same relationship to the same table).

    I'm not sure if I'm making sense. If i'm not just let me know and I'll be happy to post the DB. If there's a better way to do it I'd love to.

  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,643
    By 'enforce referential integrity' you mean in the Relationship builder? Many developers don't bother with that and use forms and code to manage data integrity.

    But I've never had to deal with a database like you describe.

    Did the UNION give you what you want?
    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
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114
    Correct, I use the relationship builder to keep the database clean. I'm definitely not a developer so coding to manage the data is a bit beyond me.

    Yes, the Union worked perfectly. Thanks again, problem solved.

    FYI - I went to the link below and followed the instructions. Very helpful.

    https://support.office.com/en-us/art...rs=en-US&ad=US

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,643
    What that does not show is that you can construct fields in the UNION with expressions.

    So if you want a field to show which table the record came from, something like:

    SELECT "Table1" AS Source ...
    UN ION SELECT "Table2" ...
    Last edited by June7; 11-20-2014 at 03:32 AM.
    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. Two Unrelated Tables and Have to Add together
    By yamalady in forum Queries
    Replies: 3
    Last Post: 11-22-2013, 09:19 AM
  2. Replies: 3
    Last Post: 02-03-2013, 08:47 PM
  3. two unrelated tables and parameter query
    By Seito in forum Queries
    Replies: 2
    Last Post: 09-12-2011, 03:01 PM
  4. Combining results from unrelated tables
    By jwreding in forum Queries
    Replies: 7
    Last Post: 08-12-2011, 01:19 PM
  5. Combine two unrelated tables with the same fields
    By lghovden06 in forum Queries
    Replies: 4
    Last Post: 07-27-2010, 03:36 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