4 Replies Latest reply on Aug 28, 2012 12:12 PM by MichaelWeisenberg

    Entering calculations directly onto a layout

    MichaelWeisenberg

      Title

      Entering calculations directly onto a layout

      Post

      I know you can add a calculation field to a layout by using the field tool. However, when using FMP 12, to save time, is there any way to enter a calculation directly onto a layout, perhaps into a text box or an empty edit box, without first creating a new calculation field in the manage database menu? Thanks for your advice.

      michaelxjw

        • 1. Re: Entering calculations directly onto a layout
          schamblee

          No.   You can't create a text box or edit box without it being connected to a field.

          • 2. Re: Entering calculations directly onto a layout
            philmodjunk

            Actually, you can by using a variable as a <<$MergeVariable>> on your layout and setting up a conditional format expression with the Let function to assign it a value. Whether it is worth it or not, is up to you.

            I learned this trick from LaRetta here in the forum:

            Add some layout text to an out of the way area on your layout such as "I declare variables".

            Give it this conditional format expression:

            Let ( $layoutDisplayVariable = /* Put your calculation here */ ; True )

            Select a font size of 500 to make this layout text invisible when you enter browse mode.

            Now put the text: <<$LayoutDisplayVariable>> on your layout and it will display your calculated result without having to add a calculation field to a table.

            Note: having worked with Visual Basic and Visual Basic for Applications, I'm familiar with forms where you can create objects on the form that have a calculated datasource built right in as part of the form's design. I've come to realize that this is an "advantage" that has a few cons along with the Pros so I advise looking before you leap into such methods.

            While keeping your table schemas to a minimum number of defined fields is a good thing in general, when you place such a layout specific calculation on your layout, the calculation is specific to that layout and that layout's current record. If it turns out you need this on multiple layouts, you can copy and paste it several different layouts, but if you then determine that this calculation needs to be modified, you have to carefully make identical changes to each layout where the calcualtion is used. That can be another round of copy and pasting in many cases, but it is still a more complex process with an increased chance of inadvertantly creating an error when compared to going to one table and modifying it's defined calculation. This also is then a calculated value that you cannot use for relationships or for which you can specify find criteria.

            Also, given issues that Filemaker 12 is having with conditional formatting (greatly improved with the v02 update), I don't know how much "faster" it really is to use this method in that version of FileMaker.

            • 3. Re: Entering calculations directly onto a layout
              schamblee

              I don't think that method saves time, but it still great to learn something new.Laughing

              • 4. Re: Entering calculations directly onto a layout
                MichaelWeisenberg

                Thanks Phil.

                Actually, you previously gave me this suggestion through a prior posting and I have successfully used it in my database. I was only trying to determine if FMP allows for a way to enter a calculation directly into a text box or blank edit box that you place on your layout as this could save some time. I know I was able to do this using Microsoft Access. Apparently, it appears that this is not possible with FMP. Your suggestion does make for a great workaround that I have used successfully. Thanks again.

                michaelxjw