Results 1 to 2 of 2
  1. #1
    Nathan Lo is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jan 2017
    Posts
    1

    Update Field using Existing field Like another Existing Field in another Table......

    I will try to explain this the best I can

    I have a table that contains a Trouble Description field called TRBL_DESC , the Table we will call "IBC" in this field technicians have entered any combination of trouble descriptions, and from that I want to create categories based on keywords. I Created another Table with Keywords and Categories then populated that with the array of information I want to check against. Table name Cat_Table and lets call the Fields "Category" & "Keyword"

    I thought that the end code to do what I want would be



    Update IBC

    SET Category = Cat_Table.Category
    WHERE TRBL_DESC Like "%" +Cat_Table.Keyword + "%";

    However, it appears that for some reason its not recognizing Cat.Table.Category and Cat.Table.Keyword as a table/field and I dont understand why, any help would be appreciated.
    when I try to run this it asks me for the user entry as if instead of it being a table/field its an undefined variable.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The second table needs to be joined. I just did something similar, here's the SQL:

    UPDATE CustomersForUpdate INNER JOIN Tbl_Customer ON (CustomersForUpdate.company_cd = Tbl_Customer.company_cd) AND (CustomersForUpdate.Cust_key = Tbl_Customer.Cust_key) SET Tbl_Customer.Email = [CustomersForUpdate].[Email];
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 11-14-2015, 07:17 AM
  2. Newbie Import. Update Field of Existing Records from Excel File
    By gedwards913 in forum Import/Export Data
    Replies: 8
    Last Post: 03-12-2015, 07:53 PM
  3. Update attachment field in existing record
    By incipientclarity in forum Programming
    Replies: 5
    Last Post: 05-28-2014, 07:20 AM
  4. Replies: 29
    Last Post: 04-25-2014, 03:49 PM
  5. Replies: 3
    Last Post: 07-30-2013, 12:11 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