Results 1 to 5 of 5
  1. #1
    blue_echo's Avatar
    blue_echo is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2016
    Location
    East Coast
    Posts
    11

    Update or Append Query


    I have two tables 'Customers' and 'Employers'. I need to update the CustomerID field in the Employers table to the CustomerID from the Customers table(primary key). I've tried using both the update and the append queries but all it does is add additional records to my employers table; not updating the existing info.

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    You have given us very little to work with - it would help if you showed us the structure of the two tables. That said, you are going to need some data (a field) in the Employers table to indicate which record in the customers table contains the new CustomerID value. If you don't have that, you cannot do what you want to do.

    If it is a one-to-many relationship between the two tables, which is the "one", and which is the "many"? In other words, does one Employer have many Customers, or is it the other way around? Give us more detail, please.

  3. #3
    blue_echo's Avatar
    blue_echo is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2016
    Location
    East Coast
    Posts
    11
    It is one-to-many. One customer with many employers. My primary key in the customers table is the customerID. I already have all the customer's employers in the employers table with their wages, etc. The relationship on the two tables is on the customer ID. But bc I had to bring their employers over separately the customerID is blank in that table. I was hoping to update that field with the respective customer. If that makes sense.

    Quote Originally Posted by John_G View Post
    You have given us very little to work with - it would help if you showed us the structure of the two tables. That said, you are going to need some data (a field) in the Employers table to indicate which record in the customers table contains the new CustomerID value. If you don't have that, you cannot do what you want to do.

    If it is a one-to-many relationship between the two tables, which is the "one", and which is the "many"? In other words, does one Employer have many Customers, or is it the other way around? Give us more detail, please.

  4. #4
    blue_echo's Avatar
    blue_echo is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2016
    Location
    East Coast
    Posts
    11
    Customers:
    CustomerID(PKey)
    Name
    Ssn#
    Address1
    Address2
    Address3

    Employers:
    EmployerID(PKey)
    CustomerID
    EmpName
    Address
    Wages
    Year
    QTR

  5. #5
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Unfortunately I think you're out of luck. The only common field between the two tables is CustomerID, and because there is no data in that field in the Employers table, you can't link them, so you can't automatically populate the CustomerID field in the Employers table.

    Might that information exist elsewhere, maybe in an Excel spreadsheet?

    Sorry I can't be of more help.

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

Similar Threads

  1. Append query with update same field
    By mladen273 in forum Queries
    Replies: 1
    Last Post: 01-15-2013, 01:56 PM
  2. Update/Append Query
    By joannakf in forum Queries
    Replies: 5
    Last Post: 05-21-2012, 04:02 PM
  3. Replies: 3
    Last Post: 03-11-2012, 03:35 PM
  4. Update or Append Query
    By Ran in forum Access
    Replies: 8
    Last Post: 01-06-2012, 12:15 PM
  5. Append/Update Query -- Need Help!
    By su-san in forum Queries
    Replies: 12
    Last Post: 11-08-2010, 12:52 PM

Tags for this Thread

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