2 Replies Latest reply on Apr 22, 2011 3:27 AM by CarlJacobs

    Extra info from table in other table related to drop-down list

    CarlJacobs

      Title

      Extra info from table in other table related to drop-down list

      Post

      Hi guys, I need some help on this one. I think it's fairly simple but I can't figure it out:

      I have two tables:

      CONTACTS

      COMPANY

      In the CONTACTS table there is:

      contact_name
      contact_email

      In the COMPANY table there is:

      company_name
      company_contact

      There is a = relationship between contact_name and company_contact
      I want to select the company_contact via a drop down list from contacts::contact_name
      That works.

      But then I want the correspondent contact_email from contact_name to appear in the company table (just for reference - no editing needed). When I do this, he always takes the first record in row. How can I achieve this?

      Thanks a lot for your intervention!


      C.J.

        • 1. Re: Extra info from table in other table related to drop-down list
          philmodjunk

          First, I recommend you link your tables by a ContactID serial number defined in your contacts table. Names are not unique, people (and companies) change their names and they are vulnerable to data entry errors and variant spellings. You can use a two column value list that lists the Contact ID in Column 1 and the Contact Name in column 2 so that your user selects the contact's name, but the value list enters the ID number.

          Then, there are two basic ways to link to the company data. The simplest and what I recommend here, is to simply add the fields (such as the contact's email address) that you want from the contacts table to your company layout. Since you don't want them to be editable, use the behavior settings in the Inspector to deny access to these fields while in browse mode or add them to your layout as merge fields--an option you can select from the Insert Menu.

          It's also possible to define fields that use looked up value settings to copy data from the related companies table, but I don't see a need for that here.

          • 2. Re: Extra info from table in other table related to drop-down list
            CarlJacobs

            Dear PhilModJunk,

            Thanks for the reply! I got ahold of it!

            C.J.