4 Replies Latest reply on Jul 27, 2010 1:05 PM by philmodjunk

    Related Tables Sharing Data



      Related Tables Sharing Data


      I currently have two tables that have five fields which I would like "table 1" to automatically enter in "table 2". Fields include date, resort, name, time and location. Is there any way to get this info from table 1 to 2 without having to copy and paste, or re-enter the data? 

      What about displaying data from two tables one layout? (I think this is the purpose of using a portal, but I believe it would still require the data to be entered.

      Thanks for your help.

        • 1. Re: Related Tables Sharing Data

          Your question identifies the central reason for setting up properly normalized, related tables for your data. You don't want to enter such data in two places--it creates major headaches if you later need to change such data as well as being a needless chore during data entry.

          You don't give me much to go on as to the purpose of tables 1 and 2. Table 2 could be an itinerarry of stops on a trip and Table 1 could be a table of travelers taking such trips. I could be wrong about that, but let's go with it for the sake of explaining this example.

          We'll call table 1, travelers. Add a field to it called TravelerID and set it up as an auto-entered serial number. We'll call the second table, Itinerary define a number field in it called TraverlID (Don't set it up to auto-enter a serial number) and you would link the two tables like this:

          Travelers::TravelerID = Itinerary::TravelerID

          In this relationship, you'd probably enable "Allow creation of records via this relationship" for Itinerary.

          Now place a portal to Itinerary on your Travelers layout. You would enter the resort name and other information once in this portal and not in any fields from the Travelers layout. Instead, the two TravelerID fields form a link and every stop on this person's trip will be a separate record with this same TravelerID number.

          Keep in mind that this is a deliberately simplified example. You'd actually need several more tables and relationships so that one traveler can make more than one trip and you'd likely want a table of resorts so that you don't have to enter the same resort name and address over and over.

          If you are unfamiliar with portals, it's an extremely good idea to read up on them in Filemaker Help as it is a very commonly used tool for working with groups of related records.

          • 2. Re: Related Tables Sharing Data

            I think it worked... I almost got it to do what you said... but it is not filling the records on the "itinerary" layout...

            I have the relationship as you said, and checked "allow creation of records..."  for the "itinerary" table... 

            In the Itinerary layout... I am displaying related fields from Travelers table... (is that correct?)

            I think the issue issue is the "travelersID" is not carrying over from the travelers table/layout into the ID field on the itinerary layout...

            Thanks again.

            • 3. Re: Related Tables Sharing Data

              I want to have a one to many relationship between the Travelers table and the Itinerary table... 

              If it helps, the travelers layout would have one record per ID while the Itinerary layout could have multiple records per each travelers record/ID...

              Hope that makes sense.

              • 4. Re: Related Tables Sharing Data

                "In the Itinerary layout... I am displaying related fields from Travelers table... (is that correct?)"

                What I described was the exact opposite. Display related records from Itinerary on the Travelers layout. If you want to do the opposite, you'd need to enable Allow creation for the Travelers table in the relationship.