8 Replies Latest reply on Aug 19, 2015 8:10 PM by LambdaEnt

    Edit box two columns

    LambdaEnt

      Title

      Edit box two columns

      Post

      I have a data entry layout with a check box field. I need a print layout where just the values are displayed, but in more than one column.

      Two-Columns.jpg

        • 1. Re: Edit box two columns
          philmodjunk

          Assuming that this is two records where the check boxes "dinner and 0700" are selected for one and "lunch, 1500" is selected for the other, you could use a calculation field with this expression:

          Substitute ( YourCheckoxFieldHere ; ¶ ; Chr (9 ) )

          This replaces the returns that separate each selected value in the field with tab characters. You can then control the amount of space between the time and the meal name by using the inspector's appearance tab to define a tab stop for this field.

          • 2. Re: Edit box two columns
            LambdaEnt

            Sorry, the first pic shows two records. No, I want the times selected in each record to be able to show in more than one column. Meal name is a time. That is one field!

            • 3. Re: Edit box two columns
              philmodjunk

              Do you have FileMaker Advanced? The first idea that comes to mind is a recursive custom function, but creating and installing such required Fileaker Advanced so this is not an option for developers that do not own that version of FileMaker.

              The basic idea is a loop that can loop through the list of values and replace every other return with either a tab character or space characters.

              Another option would be to replace this single field with a portal that still looks and functions like a check box formatted single field but where you are actually clicking buttons that create records in a related table with this data. you can then use a 2 or more portals to list this information from such a related table.

              • 4. Re: Edit box two columns
                LambdaEnt

                Actually the Substitute method works! However, Chr(9) did not. FMP thinks it's a function it can't find. I typed a tab in Notepad, copied and pasted it between quotes.

                However, they aren't sorted by time, but apparently by what was checked first. Any suggestions on that?

                • 5. Re: Edit box two columns
                  philmodjunk

                  Sorry, the correct function is Char. And yes, with the right tab stops and field width, this should work better than I originally thought.

                  To get the values to be stored in the order listed in the value list instead of the order in which they are selected, use this auto-enter calculation:

                  FilterValues ( ValueListItems ( Get ( FileName ) ; "YourValueListNameHere" ) ; YourCheckboxFieldHere )

                  And be sure to clear the "do not replace existing values..." check box.

                  • 6. Re: Edit box two columns
                    LambdaEnt

                    At FileName I am getting "This parameter is an invalid Get function parameter". What is the proper format?

                    I've tried it a few ways.

                    FilterValues ( ValueListItems ( Get (Daily Regimen.fp7) ; "Time" ); Time)

                    FilterValues ( ValueListItems ( Get ("filemac:/Macintosh HD/Users/salm/Dropbox/To Reva/Daily Regimen.fp7") ; "Time" ); Time)

                    • 7. Re: Edit box two columns
                      philmodjunk

                      It is literally Get ( FileName ) that you use. Not Get ( Daily Regimen.Fp7 )

                      The idea here is to use an indirect method of getting the file name so that changing the file name doesn't break this calculation.

                      The alternative would be to use:

                      ValueListItems ( "Daily Regimen.fp7"

                      but then you can't rename your file.

                      If you look up the Get function in FileMaker help, you'll find that this "Swiss army knife" function has all kinds of different parameters that you can use to get different values. Get ( FileName ) is just one such function.

                      • 8. Re: Edit box two columns
                        LambdaEnt

                        Thank you!