Results 1 to 2 of 2
  1. #1
    Justin Bailey is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Location
    nyc
    Posts
    3

    Auto-Populate FK in table

    hi, I'm relatively new to Access.
    I have two tables. both from imported data.



    Table1: ID, City, Customer FK [no data yet]

    Table2: ID, Customer, City, City FK [no data yet]


    The City field data in Table1 and Table2 are identical. Table2 had already came imported with data of customer/city relationship in two independent fields inside one table, is there a way to easily auto-populate the City FK in Table2 and have the corresponding Customer FK in Table1? then afterwards safely remove the redundant city field data in Table2 ? Would some kind of query or update method work for this task?

  2. #2
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    Equal join the two tables on City and update [City FK] with Table1.ID. I don't think you have to specify criteria (WHERE City in one table = City in the other) due to the equal join. Then you can go into table design and delete the City field. The thing is, what is the purpose of first table? If it's customers, the city fk should be there, not the city. If it's a city table, the customer fk should not be there. Wondering if you should research database normalization before going any farther.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Auto populate table with dates
    By Sidran in forum Access
    Replies: 7
    Last Post: 08-04-2014, 10:04 AM
  2. Auto populate a table
    By keiath in forum Access
    Replies: 5
    Last Post: 02-16-2014, 01:56 PM
  3. Replies: 2
    Last Post: 08-22-2012, 07:59 AM
  4. Auto-populate from another table
    By Palladian1881 in forum Access
    Replies: 2
    Last Post: 08-16-2011, 11:29 AM
  5. auto populate and table relationships
    By jmarti57 in forum Access
    Replies: 0
    Last Post: 11-09-2008, 09:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums