5 Replies Latest reply on Apr 24, 2014 11:48 AM by philmodjunk

    Lookup from a Last Entered Record

    J.L.

      Title

      Lookup from a Last Entered Record

      Post

           I have created a database in FileMaker 12 that contains name and address fields. When I enter a name, the address enters automatically. My problem is that the address is being pulled from the first record ever entered. This causes a problem when the address changes. I would like to have the last entered address related to the name enter automatically but have not been able to do it. I'm sure it's a simple thing. Any ideas?

        • 1. Re: Lookup from a Last Entered Record
          philmodjunk

               And does this mean that you have two tables? One table where you enter a name and the other where you have records with name and address fields?

               It would appear that you keep previous names and addresses in this table. Are you sure that this is what you want?

               Do you have any other fields besides name and address in this table? Such as an auto-entered serial number?

               With an auto-entered serial number, or possibly a date field, you can sort your relationship so that the first related record is the record with the largest serial number or the most recent date.

               But if you are doing this by name, beware, it's quite possible to get several people with exactly the same name and then your system won't work to look up addresses by name alone.

          • 2. Re: Lookup from a Last Entered Record
            J.L.

                 Thank you for your response. My experience with databases is not that great. One of my fields is the date/time. What steps would I have to complete in order to sort the relationship so that it would be the most recent date/time?

            • 3. Re: Lookup from a Last Entered Record
              philmodjunk

                   Open Manage | database | Relationships

                   Find the relationship line that links your two tables.

                   Double click it.

                   This opens a dialog box where you'll find a Sort button that you can click to specify a sort order. If you sort your records by date/time in descending order, the most recently created record will be the "first" related record.

              • 4. Re: Lookup from a Last Entered Record
                J.L.

                     That worked! Thank you so much.  One more question... If I have two fields, let's say "Email Address" and "Label".  Is it possible upon entry of the record to have the word "Yes" enter into the "Label" field automatically if nothing is entered into the "Email Address" field? What steps would I have to do?

                • 5. Re: Lookup from a Last Entered Record
                  philmodjunk

                       If ( IsEmpty ( Email Address ) ; "Yes" )

                       or possibly:

                       If ( IsEmpty ( Email Address ) ; "Yes" ; self )

                       The first could be either a calculation field or a text field with an auto-entered calcluation. The second version is a possible auto-enter calculation.