3 Replies Latest reply on Jan 24, 2015 5:49 PM by philmodjunk

    records in multiple tables



      records in multiple tables


      How do I automatically create a record in a second table in the same data base when I create a new record in the first table?

        • 1. Re: records in multiple tables

          Please describe what you are trying to accomplish. It's not clear why you would want the same data(?) in two different tables.

          • 2. Re: records in multiple tables

            I have different kinds of data that I would like to have in separate tables.  Each record of the primary table will have a parallel record with different kinds of information.  ie  General information on the primary record and products purchased say in a secondary table.  But I know that I will be need both types of records when I set up the primary record and so want the parallel record to be started when I  establish the primary record.  There is enough information in each type of record that it would be visually overwhelming.

            • 3. Re: records in multiple tables

              But what problem do you solve by that? You can do it, but it's quite simple in FileMaker to add related records on an "as needed" basis instead of creating both records at the start.

              but it can be done:

              TableA::_pkTableAID = TableB:_fkTableAID (enable "Allow creation of records via this relationship" for TableB.)

              #Starting on a Layout based on TableA:

              #Create TableA record
              New Record Request
              #Create on related TableB record
              Set Field [TableB::_fkTableAID ; TableA::__pkTableAID ]

              This creates one and only one related record in Table B.

              There are other scripts that can be used that create multiple TableB records all linked to the current TableA record.