Forum Discussion

AnthonyPluchino's avatar
AnthonyPluchino
Qrew Member
12 months ago

Setting up the relationship between two tables

I have two tables. One table contains basic info, county, phone number, area code prefix. The second table contains the county and area code prefix. In the first table I want to select the the area code prefix in table 2 based on the county in table 1. The lookup would be the match the county in table 1 to the county in table 2 then use the area prefix code from table 2 and place it in table 1, area code prefix field. 



------------------------------
Anthony Pluchino
------------------------------

2 Replies

  • You could create a relationship between the two tables - your second table is the 'parent' with zero, one or many records in the first table. When you do this, county is likely to be defaulted 'proxy' field for the relationship, but if not you can change the default. You would use this field to select the county in records in the first table, meaning the county field already set up in that table is not needed. Adding the area code prefix as a lookup field to the relationship should give you what you need; again, the field you have already set up would not be needed.

    You do have an alternative option, which is to create a formula query field to lookup the area code prefix in the second table by matching on county, but I would go down the first route.



    ------------------------------
    Jeremy Anson
    ------------------------------
    • AnthonyPluchino's avatar
      AnthonyPluchino
      Qrew Member

      Thanks for the feedback, I will try it



      ------------------------------
      Anthony Pluchino
      ------------------------------