1 2 Previous Next 17 Replies Latest reply on Jan 20, 2010 3:21 PM by hsutton47

    Embed One Form In Another (same db file)



      Embed One Form In Another (same db file)


      1.  Hello, I am going in circles trying to do what I could easily do in Access.  I have created a browser list view of contacts.  I also have a detailed form of all fields.  What I am trying to do is create a form where the upper half contains the contacts detailed form and the bottom half displays the browser list of records.  The portal option does not allow me to point to another layout in the same db.


      2.  If I can do that, then what i would like is, what ever record I click on in the browser list of records will select/display the detailed record's layout in the upper half.  For that functionality, will that require a script that reacts to selecting a record in the browser list displays the detailed record in the other layout?  And likewise, if I navigate up/down in the detailed record view, I would like it to auto-select the same record in the corresponding layout's browser list view.


      I have tried for over a day to figure this out on my own to no avail.  Thanks for any assistance.



        • 1. Re: Embed One Form In Another (same db file)
             sorry for not including additional info.  I am using FileMaker Pro 10 Advanced in Windows 7 Professional.
          • 2. Re: Embed One Form In Another (same db file)

            You might examine the Contact Management Template

            It allows the lower portal to display related records by Name  Company  OR  City

            In your case it would be a global field for the relationship for the list displayed. 

            • 3. Re: Embed One Form In Another (same db file)

              appreciate your response but actually that is exactly what i am using as a starter point.  The bottom half is additional fields (tabs) for address1 and address2 on the first tab.  i have modified to have all the pertinent fields in the upper half and want to embed my browers layout in the bottom half and link them for navigation purposes.


              • 4. Re: Embed One Form In Another (same db file)

                it is doable, but not easy the way you are requesting... as you will most likely need to use a script and either use global fields to restrict the found set, or, enter find mode and return the desired record...


                however, if you show a list on the form, and when select a record there it will show related records in a portal...


                • 5. Re: Embed One Form In Another (same db file)

                  Still not able to figure this out.  Can someone give me direction on how to create a split display where a list of records is in one part of the display, and which ever record is selected in the list, in the other portion of the screen displays a layout of fields for that record.


                  For example, I have a list layout called "browse records" that shows a few fields like Name, Phone#, etc. 


                  I have another layout called 'detail record' that shows additional fields.


                  I need to create a composite layout where the 'browse records' layout occupies half of the screen/window, and either above or below it in the other half, the 'detail record' layout is shown.


                  When a user selects a record (line) in the 'browser list' portal, the other part of the screen displays the 'detail record'.


                  In Access this is nothing more than embedding one form inside another and linking the Record Number fields.  I can't believe Filemaker cannot easily do this.  Any help appreciated.

                  • 6. Re: Embed One Form In Another (same db file)

                    Put a button in your list layout or make the entire row of fields one button and set it to peform this script:


                    Set Variable [$ID; YourTable::YourIDField]

                    Go TO Layout [//specify your detail layou]

                    Enter find mode[]

                    Set FIeld [YourTable::YourIDField; $ID]

                    Perform Find[]


                    That's it once you substitute your table and field names for my placeholders. (I'm assuming both layouts refer to the same table.)



                    • 7. Re: Embed One Form In Another (same db file)

                      Thanks Paul but I don't see how this gives me the functionality I am looking for.  How does this give me the ability to have, in the same layout view, a 'split' window where i see the browser list layout in one part, and in the other part, when a record is selected/clicked in the browser portal, that record's detail layout is reflected in the other?


                      I tried using the Insert Portal to point to a different layout in the same table/db, but it does not give me the option to select a different layout in the same table/db.


                      • 8. Re: Embed One Form In Another (same db file)

                        I was responding to your last post:


                        "For example, I have a list layout called "browse records" that shows a few fields like Name, Phone#, etc. 


                        I have another layout called 'detail record' that shows additional fields."


                        Which indicated that you have two layouts not one.


                        The same approach works with a single layout, if you set it up right.


                        Set up a portal listing all your records. You can set up a self-join with the X operator instead of =.

                        Open Manage | Database | Relationships

                        Find the Table Occurrence (TO) box for your table.

                        Drag from its primary key, I'll call it "ID" for this example, outside the box and then back to the same field.

                        In the dialog that pops up, name your new TO something meaningful, I'll call it "AllRecs".

                        Double click the relationship line linking these two TO boxes and change the = to X.

                        You should now see:

                        YourTable::ID X AllRecs::ID

                        Put a portal to AllRecs on your detail layout.

                        Put the fields from AllRecs that you want  in your portal and either make them a button or put a button in the portal row.


                        Your script would look like this:

                        Set Variable [$ID; AllRecs::ID]

                        Enter find mode[]

                        Set Field [YourTable::ID; $ID]

                        Perform Find[]


                        You can even use conditional formatting to highlight the row you clicked to bring up this record.

                        • 9. Re: Embed One Form In Another (same db file)

                          Phil, thanks so much.  I would have never figured that out but then I'm jumping in on my own and not very familiar with FM.  I have the split display with the embedded portal of browser layout and detailed record.  I attached the script you wrote and associated it with the name field in the browser list so when that field is clicked the detailed record area of the display pulls up that record.  When I edit in the detail record, the changes are reflected in the browser list.


                          The only quirk right now is, for example if I scroll down to the S's and click on that record, once the detailed record displays, the browser portal resets to the top of the display showing the A's.  It would be preferable for the browser display to stay where it is.


                          I also notice in the banner area where the "book" is on the left side that allows you to move from record to record is grayed out and I cannot "travel" using that feature.  Guess there's a lot of figure out but this was very helpful so thanks agian.

                          • 10. Re: Embed One Form In Another (same db file)

                            The method I've posted is the "beginner's version". It sets up a found set of one record--that's why you can't scroll through the records and the find changes which record is the current record and that's why the portal scroll bar "pops" back on you.


                            You can also set up an additional table with a single global field that links to your ID field. You'd base your layout on this new table and place the fields you want for your detail record from the related table. Your portal click would then use set field to assign your ID number to this global field to bring up the record details. Now your portal scroll bar will stay put and you can even set up a conditional format expression that compairs your global field to the portal record's ID to highlight the selected portal row. You still can't move from record to record via the scroll bar, but since you have this nice scrolling portal of all records, maybe you don't need to...:smileywink:


                            Another option is to set up a filter on your portal to eliminate/reduce the need for scrolling. (A filtered portal uses a second pair of fields to match to a subset of the records that would be otherwise listed in the portal. A combo box or other value list format is put on the parent record's filter field to select specific subsets of matching records--such as all records with a name field starting with "A"--for one example.)

                            • 11. Re: Embed One Form In Another (same db file)

                              Wow this actually did go over my head and I would love to figure this out.  Unfortunatley I am headed out of town for a week so will have to try and work on this later on.


                              But I was thinking of putting buttons over the browser portal like a rolodex e.g., [A] [B] [C] etc and each button would jump to the beginning of the letter/button pushed.  


                              So do you have a quick script suggestion for doing that at least?  If I put a button above the portal called [S] and click on it, the script would find the first occurence of "S" in the last name field (beginning letter only, not just any "S" in the field) and position the browser list with the first occurence at the top of the window.


                              If I am asking for a lot of time don't worry about it, definitely appreciate what you've provided here.  Thanks again.

                              • 12. Re: Embed One Form In Another (same db file)
                                   In the "portal setup" uncheck the box that says "Reset scroll bar when exiting record." this will prevent it from jumping back to the top of the list.
                                • 13. Re: Embed One Form In Another (same db file)

                                  WoodApple, I considered that possibility, but the find operation causes the portal to snap back even if this option is not selected. I just ran a brief test to be sure.

                                  • 14. Re: Embed One Form In Another (same db file)
                                       Yes I was just responding with the same result when I saw Paul's input. 
                                    1 2 Previous Next