Page 1 of 2 12 LastLast
Results 1 to 15 of 26
  1. #1
    Maxjoo is offline Novice
    Windows 11 Office 365
    Join Date
    Jul 2024
    Location
    Carmel, Indiana, USA
    Posts
    18

    Question How to link various tables using a single common field

    I am trying to link 15 tables using a common field, OrderId, in order to create a form/report to print specific data from the tables. Thank You in advance for your help!!!!

    Because the tables I was given to work with already have data on them (very incomplete data, some with 9 fields (or less), some with 11), I am trying to separate some common fields and place them in a new table linked to the 15 other ones.

    This is an example of what I am trying to do:

    table1; table2; table3; table4...


    |
    |
    |
    Orders table

    Each table contains (should contain...) 11 columns/fields; the fields I want to link (and place in Order table) are: Building Name, Crew Leader, Work Done, Date Ordered, Done Date. I know I have to place a primary key to index the records on the tables; it is an AutoNumber. I stopped here, because I got nothing in Orders table...
    Last edited by Maxjoo; 07-19-2024 at 10:04 AM. Reason: To clarify some details on my question

  2. #2
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    564
    Fifteen tables??? What does you schema look like?

    to answer your question, though, the primary key in the parent table would be Autonumber, and all the child tables with foreign keys to relate back to that would have a Long Integer column as the foreign key. Then you can join them (Make sure the index on the child tables is NOT unique on the foreign/join key.)

  3. #3
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,165
    Keep in mind there is a maximum of 16 joins in a query, sometimes less.

    As mentioned you may need to reconsider your db design, or you may have to use temporary tables.

  4. #4
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    564
    Could you post your table structure or a copy of your database with only a few (literally 2-3!) records per table? Something here doesn’t sound right… and it could be a “fix in now for cheap or fix it for a lot later” thing

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Max,

    More info required. It would help if you could provide a 2 or 3 line overview (30,000 ft level) of what your database is intended to support. And, as has been requested, the tables involved and the linkage you would like with this "common field".

  6. #6
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    564
    I agree with Orange. Once I understand how the pieces should fit, I can bash out the tables. Other people here are way better at UI stuff than I am. But a solid design will make your life infinitely easier later!

  7. #7
    Maxjoo is offline Novice
    Windows 11 Office 365
    Join Date
    Jul 2024
    Location
    Carmel, Indiana, USA
    Posts
    18
    Because the tables I was given to work with already have data on them (very incomplete data, some with 9 fields (or less), some with 11), I am trying to separate some common fields and place them in a new table linked to the 15 other ones.

    This is an example of what I am trying to do:

    table1; table2; table3; table4...
    |
    |
    Orders table
    OrderID (Field linked to the source table)
    Building Name
    Crew Leader
    Work Done
    Date Finished
    ID (Field linked to the source table)

    Each table contains (should contain...) 11 columns/fields. I know I have to place a primary key to index the records on the tables; it is an AutoNumber. I stopped here, because I got nothing in Orders table...

  8. #8
    Maxjoo is offline Novice
    Windows 11 Office 365
    Join Date
    Jul 2024
    Location
    Carmel, Indiana, USA
    Posts
    18

    Exclamation

    Because the tables I was given to work with already have data on them (very incomplete data, some with 9 fields (or less), some with 11), I am trying to separate some common fields and place them in a new table linked to the 15 other ones.

    This is an example of what I am trying to do:

    table1; table2; table3; table4...
    |
    |
    Orders table
    OrderID (Field linked to the source table)
    Building Name
    Crew Leader
    Work Done
    Date Finished
    ID (Field linked to the source table)

    Each table contains (should contain...) 11 columns/fields. I know I have to place a primary key to index the records on the tables; it is an AutoNumber. I stopped here, because I got nothing in Orders table...

    I cannot upload the file, is too big for the requirements...

  9. #9
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,740
    Are table1; table2; table3; table4... constructed identically? Is there any logical relationship between those tables?
    Are all the records in table1 for the same building? (and all in table2 for another same building, etc. for keeping track of 15 buildings)
    Is your end result essentially combining the 15 tables into a single new table?
    Is this a one-off procedure, or will it be on-going over time?
    Last edited by davegri; 07-19-2024 at 12:19 PM. Reason: more questions

  10. #10
    Maxjoo is offline Novice
    Windows 11 Office 365
    Join Date
    Jul 2024
    Location
    Carmel, Indiana, USA
    Posts
    18
    Thank You davegri for replying so fast!!!!!

    Your questions practically resume my dilemma with this db. I took the data from a HUGE Excel file (15 tabs/building), between 1-2 megabytes; I was able to reduce the size of the file to 85kb by eliminating the format that was applied to it, colors, letter style etc. Then, I took each tab to create an access table for each excel tab/building. The problem is not all the tables/tabs have the same number of columns. I decided to work with the one that has most fields. I do not want to combine the tables; I just want to use the fields on them and to add new records on each one. How can I make them uniform, without losing data, in order to work with them. This task is for a client...

  11. #11
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Max,

    Access is not Excel--they are built on different object models and serve different purposes. To help you, readers need to understand what you are trying to do -and by this I mean at the "business process" level NOT vba code or code level. Based on Davegri's questions/comments please expand your description and describe to us WHAT exactly you have and what you need as a result.

  12. #12
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    564
    Quote Originally Posted by Maxjoo View Post
    Thank You davegri for replying so fast!!!!!

    Your questions practically resume my dilemma with this db. I took the data from a HUGE Excel file (15 tabs/building), between 1-2 megabytes; I was able to reduce the size of the file to 85kb by eliminating the format that was applied to it, colors, letter style etc. Then, I took each tab to create an access table for each excel tab/building. The problem is not all the tables/tabs have the same number of columns. I decided to work with the one that has most fields. I do not want to combine the tables; I just want to use the fields on them and to add new records on each one. How can I make them uniform, without losing data, in order to work with them. This task is for a client...
    Say you add a column to the table so you can specify the Building the record belongs to, then can you append all the spreadsheets to a single table?

    If the data's not crazy confidential, I can do it. (I'd likely do it in PowerQuery, because the field types aren't crazy inflexible like they are in Access), and then I'd import that result. (Just Append all the results together, once you add the information about building.)

  13. #13
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,818
    Hi Everyone
    I have been in contact with Max and he does not want to accept my help with trying to sort out what he calls a databasae.

    I attach his attempt and he does not want to put all 15 tables into 1 table.

    All of the 15 tables are a mess anyway.

    He has multiple records with finish dates but no start date etc

    He has gone down the normal route of spaces in names, ID PK for every table, Lookup fields in tabes etc..

    He is expecting to be paid for this database


    See attached.
    Attached Files Attached Files

  14. #14
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,421
    I hope you had his permission to post a db given to you in a private message.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  15. #15
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,421
    @Maxjoo; you need to understand db normalization. Suggest you save yourself a lot of headaches and review these
    https://www.accessforums.net/showthr...773#post521773
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 03-26-2020, 06:09 AM
  2. How to Link multiple tables to one field
    By roderickchandra@gmail.com in forum Programming
    Replies: 3
    Last Post: 05-26-2017, 12:51 AM
  3. Link Common Fields Between Tables
    By craignovice in forum Macros
    Replies: 3
    Last Post: 01-12-2015, 04:21 PM
  4. Link two queries without common fields
    By JGrots in forum Queries
    Replies: 27
    Last Post: 04-04-2013, 01:31 PM
  5. Replies: 7
    Last Post: 03-08-2013, 03:58 PM

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