7 Replies Latest reply on Aug 23, 2009 4:04 PM by comment_1

    Conditional Printing from 2 Tables in a Database

    GeorgeM

      Title

      Conditional Printing from 2 Tables in a Database

      Post

      <!-- StartFragment -->

      I am trying to print Name Badges from two tables based on aconditional “Find” in Table 1.

       

      Table 1 contains records with myriad information and fields.  Each record has a unique “file number ”field which links it to Table 2. Each file number represents a unique “company” entity (Company name,address, etc.).

       

      In Table 1 there is a field in each record in which I put a“y” if I want to print out meeting badges for people from that companyentity.   Table 2 contains thefirst and last names of people from the various company entities who will beattending the meeting.   How doI print out the name badges based on the above?  I can print the badges based on Table 2 but I can’t limit itto only those companies who I have identified with a “y” in the appropriate Table1 field.

       

      Secondly, I have spouse’s names included in Table 2.  If a spouse will be accompanying theperson attending, I put a “y” in a “Spouse Attending” field in Table 2.  How do I also print a badge for thespouse based on the above?

       

      I am a new user to FileMaker.  I previously used Access and have converted the above Databaseand Tables from Access to Filemaker.

       

      Thanks for your help.

       

      George M 

      <!-- EndFragment -->

        • 1. Re: Conditional Printing from 2 Tables in a Database
          philmodjunk
            

          Let's assume your company ID ("file number") is stored in a global field. (It could also be stored in a variable or passed as a script parameter.)

           

          Enter Find Mode []

          Set Field [Table2::FileNumberField; Table::globalfield]

          Set Field [Table1:: PrintCompanyYfield; "y"]

          New Record/Request

          Set Field [Table2::FileNumberField; Table::globalfield]

          Set Field [Table1:: PrintSpouseYfield; "y"]

          Perform Find []

           

          Creating two requests like this is the logical equivalent of an "OR" while specifying different criteria within the same request is the logical equivalent of "AND".

           

          • 2. Re: Conditional Printing from 2 Tables in a Database
            GeorgeM
              

            Perhaps I wasn't clear enough in my original post.  Table 1 contains 651 records, each of which is a separate company (ABC Manufacturing, AllClean Supplies, etc.)  Each record has a file number that is unique to that record.

             

            In Table 2, I have a list on first and last names, and first names of spouses from each company.  Some companies might have 10-20 persons (hence names) of people attending the meeting.  In Table 2 the company is identified by a file number that is linked to Table 1.

             

            The File Number is not a global field.  I want to print the names of people attending from each company, based on a "Y" in a field for each record in Table 1.  The "Y" would indicate that that company is being represented at the meeting by the persons in Table 2 from that company.

             

            As a second printing, I want to print the names (first and last) of spouses accompanying each person from the company represented, if they (the spouses) are attending the meeting based on a "Y" in a field in Table 2.

             

            Does this clear up what I'm trying to do?  Is there an easier way to do it?

             

            Thanks for your help. 

            • 3. Re: Conditional Printing from 2 Tables in a Database
              comment_1
                

              For the first pass, search Table 2 for "Y" in the RELATED field from Table 1.

               

              For the second pass, constrain the found set in Table 2 by searching for "Y" in the LOCAL field.

              • 4. Re: Conditional Printing from 2 Tables in a Database
                GeorgeM
                   I;m a novice user.  How do I do what you suggest?
                • 5. Re: Conditional Printing from 2 Tables in a Database
                  comment_1
                    

                  You can do this manually, or script it.

                   

                  I could probably explain this bettter if you provided names for your tables and fields.

                  • 6. Re: Conditional Printing from 2 Tables in a Database
                    GeorgeM
                      

                    Table 1 is titled "Database."  The field which indicates if a company will be atending is "Attend Conf"

                     

                    Table 2 is titled "Names"  The field which indicates if spouses are attending is "Spouse Attend"

                     

                    I would prefer to do this manually as I don't know scripts at this point in my learning curve.  I started converting to Filemaker 3 months ago and am learning based on the Filemaker Bible.

                     

                    Thanks for your help. 

                    • 7. Re: Conditional Printing from 2 Tables in a Database
                      comment_1
                        

                      First, go to a layout of Names, enter Layout mode, and place the field "Attend Conf" from the Database table on the layout (this is only required for a manual find, not for a scripted one).

                       

                       

                      Now, for the first pass: enter Find mode, type "Y" (without the quotes) into that field, and press Enter (or select Requests > Perform Find).

                       

                      For the second pass: enter Find mode, type "Y" (without the quotes) into the "Spouse Attend" field, and select Requests > Constrain Found Set.