0

How to locate N:1 relationships that contain data?

I have created an Orders table that is associated with three tables named after people's names. I want to use a code snippet to locate the associated tables (the ones that contain data). For example, the second row of the Orders table has data for Emma Johnson. How can I edit this code?

6 replies

null
    • Fred
    • 4 mths ago
    • Reported - view

    Are you trying to figure out if a reference field has a link? And if it does then to use that link? Will there be times that more than 1 reference field is used? Could all three be used?

    It can be done, but with a structure change it can make the coding simpler.

    You may want to consider creating one table with a field that stores the people's names and other fields that store the specific data you need.

    • gold_cat
    • 4 mths ago
    • Reported - view
     said:
    Are you trying to figure out if a reference field has a link?

    Yes,Fred

     said:
    And if it does then to use that link?

     If it contains a link, it will extract related elements from within the table (the content format that needs to be extracted within the three forms is the same).

      said:
    more

    There will not be multiple reference fields; only one reference field will appear. They can all be used, but I need to confirm which reference contains the related information.

     said:
    It can be done, but with a structure change it can make the coding simpler.

     Could you share the two approaches of not creating and creating?

    "Additionally, the name form will have new entries."

    • Fred
    • 4 mths ago
    • Reported - view
     said:
     Could you share the two approaches of not creating and creating?

    Take a look at the attached DB. You can see how much simpler Formula 2 is compared to Formula. Since you never have more than 1 person linked, then a subtable will work. Or you can even just link to the new People table in Orders and get to the same data.

    I guess you could even use the three people reference link in the subtable, but on the surface it seems like a problemsome design choice.

      • gold_cat
      • 3 mths ago
      • Reported - view

       Thanks for your reply, Fred. Formula 2 has an issue with my case. If I remove the association of the first record in Orders with John Smith and choose Emma Johnson instead, how can I synchronize my choice in Formula 2?

      • Fred
      • 3 mths ago
      • Reported - view

      Just to be clear you wouldn't use both systems.

      But for testing, you just need to change the People link in subOrder.

      • gold_cat
      • 3 mths ago
      • Reported - view

      Thank you Fred. I understand

       

Content aside

  • Status Answered
  • 3 mths agoLast active
  • 6Replies
  • 48Views
  • 2 Following