3 Replies Latest reply on Jul 23, 2011 11:02 AM by rgnant_1

    Auto Enter First Name Based on Last Name

    rgnant_1

      Title

      Auto Enter First Name Based on Last Name

      Post

      Have a Last Name field with auto-complete using the value list "Last Name."  If the last name is unique, I would like the First Name field to be automatically filled in.  If there are two or more people with the same first name, I would like the same auto-complete process as for the last name.

      Any suggestions would be appreciated.

        • 1. Re: Auto Enter First Name Based on Last Name
          LaRetta_1

          The more common way of handling this situation is to avoid it.  Your customers should have a unique, FM-generated auto-enter serial.  Then you would create a calculation ( result is text) in your customers table which concatenates name and phone (or street address) such as:

          LastName & ", " & FirstName &  " " & Phone

          Then set up the value list to insert the unique ID into the foreign key CustomerID field but display name also of the calculation so User can select the correct Customer.  Once the CustomerID is in the table, the name of the customer can be displayed directly from the Customer table - no need to automatically 'fill in' the first name.  By using primary keys in this way, it eliminates redundant information, i.e. the customer name should only ever appear in one place ... the Customers table.

          If you instead insert the customer name again in this other table and the customer name is incorrect (or the customer changes their name), you would have to change the spelling through all your records.  Each bit of data should only ever be entered once in a database structure. :^)

          • 2. Re: Auto Enter First Name Based on Last Name
            rgnant_1

            But then I have to enter a customer number in order to retrieve the name, right?

            • 3. Re: Auto Enter First Name Based on Last Name
              rgnant_1

              Thanks everyone.  I figured it out.