8 Replies Latest reply on Jul 13, 2011 7:40 AM by philmodjunk

    Autofill a field when content is entered in a different field with a specific word

    selmorzine

      Title

      Autofill a field when content is entered in a different field with a specific word

      Post

      Hi,

      I need some help. I would like a field to autofill with the word Yes, when a date is entered in another field and I can't find out how to do it.

      Basically, when a date is entered in field named "Date Deposit Paid" I would like the "Deposit Paid" field to fill with the word "Yes"

      I would really appreciate any help,

      Many thanks,

      selmorzine

        • 1. Re: Autofill a field when content is entered in a different field with a specific word
          LaRetta_1

          Actually, you don't need another field at all.  If you choose to add a new field, it should be calculation (result is text) with:

          Case ( Date Deposit Paid ; "Yes" )

          ... but as I suggested this calculation is unnecessary.  You can instead simply place another copy of your Date Deposit Paid field on your layout.  Turn off entry to the field (using inspector).  Then go to your Data tab of Inspector and, at the bottom, set the date format as:

          Turn every option to blank on all lines.  But on the first line, type Yes into the far right box.  In this way, if there is a date, this field on your layout will say 'Yes' but otherwise will remain blank. 

          One should always think about whether creating a calculation or new field is necessary.  Until FileMaker provides an option to organize fields into folders, searching a long list of fields is major PIB and most developers will do anything NOT to create a new field unless absolutely necessary.  It helps that we can use Developer Assistant (DracoVentions) to find fields quickly but, for the sake of solution speed, the fewer fields (particularly calculations), the faster/smaller your solution.

          • 2. Re: Autofill a field when content is entered in a different field with a specific word
            selmorzine

            Brilliant, that worked a treat! Sorry, I am pretty new to filemaker and still don't really know all the ins and outs of what to do and not to do.

            I have one more quick question, what would be the best way to make the following happen;

            I have a "Deposit Due Date" field, this date highlights in red if not paid 7 days prior to the date, the date in here is set automatically as 42 days after the booking date. How can I get the date to go green, as soon as I enter the payment date into the "Deposit Paid Date" Field? 

            I am pretty sure that there is an easy answer to this one too, but I can't quite figure it out.

            Many thanks for your help

            • 3. Re: Autofill a field when content is entered in a different field with a specific word
              LaRetta_1

              You would use conditional formatting.  Leave your Deposit Due Date red but attach conditional format with formula of:

              Deposit Paid Date

              This is a Boolean test and if true, the conditional format will fire.  Since dates are numbers it will respond to this test as true if there is ANY date in Deposit Paid Date.  Now below in the conditonal format, select color green for text.  In this way, Deposit Due Date will turn green when any date is added in Deposit Paid Date.

              • 4. Re: Autofill a field when content is entered in a different field with a specific word
                selmorzine

                Worked perfectly. Who would have thought that something so simple would do this!

                One more for you, I send out invoices for bookings, which can hold from one line to 20 lines in the body part of the invoice (each line per item booked) With the total amount appearing in "Sub-Summary by booking ID (Trailing)" then rest of content which is standard in "Trailing Grand Summary" and then a "Footer".

                I have a big problem with getting the body content to rollover properly on the invoice, without having the total amount placed on another page.

                If I set it to do a page break on a certain amount of lines, it works ok until I get a big booking or a booking of just the correct amount and then it doesn't work properly, it will either place all body on the first page and then the total on the next page with a big space under the body part or it will place the body on a few pages with total on the last page with the rest of the content.

                Is there a way of setting it to choose automatically to fit the body and then always have to total amount either on the first page (if not more than 6 lines in body) or if it has to go onto the next page, it always brings that last line of the body with it, instead of just bringing the total.

                At the moment I have to set a page break manually if the invoice does go over 6 lines but would like it to decide on its own and always get the invoice laid out properly without having to adjust it.

                I hope that the above makes sense!

                Thanks.

                • 5. Re: Autofill a field when content is entered in a different field with a specific word
                  rjlevesque

                  The use of Summary fields would accomplish that task...

                  • 6. Re: Autofill a field when content is entered in a different field with a specific word
                    selmorzine

                    I have tried Summary Fields all the ways I know and following the instructions but can't get it to work, so I am definitely doing something wrong, I have to keep adjusting where the page break occurs. 

                    I am new to filemaker so still learning, any help as to how to do it would be great! Smile

                    • 7. Re: Autofill a field when content is entered in a different field with a specific word
                      rjlevesque

                      Have you looked at the Invoices starter solution that comes with FMP? This is not difficult to do, but I think you will understand it better if you open that starter solution and look at their invoice printing. The layout and scripting will help you learn how to accomplish reports like that easily.

                      Its not hard to do, just a lot to explain. You will need a special layout for printing your report in the format you desire. Then you have to make sure all body parts do not exceed the available printing space per page for your printer.

                      • 8. Re: Autofill a field when content is entered in a different field with a specific word
                        philmodjunk

                        Comment's Invoices demo file uses the same method, but is stripped down to just the bare essentials--which can make it easier to figure out: 

                        http://fmforums.com/forum/showpost.php?post/309136/