Results 1 to 3 of 3
  1. #1
    anthgav is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Posts
    86

    Update query with a joined read only table

    Hi

    I have 2 tables...
    dbo_stockm_View - Read only table linked from the company's database
    tblProduct - This is a table within Access

    I have the following update query...
    Code:
    UPDATE tblProduct LEFT JOIN dbo_stockm_View ON tblProduct.product = dbo_stockm_View.product SET tblProduct.allocated_bin_1 = Null
    WHERE (([dbo_stockm_View].[bin_number]="DISCITEM"));
    After running the query I get the following error...
    "Operation must use an updateable query."

    I believe this message is showing because I'm joining a read only table to check for the criteria, is this possible?
    Any ideas on why I'm getting this error?

    Thanks.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    you cannot SUM and update in the same query(s).
    you cannot update a table with certain joins.

    I usu write my updates to a temp table, then update the main data from the temp table. (2 queries)

  3. #3
    anthgav is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Posts
    86
    Quote Originally Posted by ranman256 View Post
    you cannot SUM and update in the same query(s).
    you cannot update a table with certain joins.

    I usu write my updates to a temp table, then update the main data from the temp table. (2 queries)
    Thanks for the suggestion, I'll bare that in mind if I get stuck in the future but I managed to make it work by adding DISTINCTROW to the code

    Code:
    UPDATE DISTINCTROW tblProduct INNER JOIN dbo_stockm_View ON tblProduct.product = dbo_stockm_View.product SET tblProduct.allocated_bin_1 = Null
    WHERE ((dbo_stockm_View.bin_number)="DISCITEM"));

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

Similar Threads

  1. Update Query with three joined tables
    By jadams0304 in forum Queries
    Replies: 9
    Last Post: 06-24-2017, 07:13 PM
  2. Replies: 0
    Last Post: 09-13-2016, 07:31 AM
  3. Replies: 1
    Last Post: 05-06-2015, 04:28 AM
  4. Replies: 8
    Last Post: 10-03-2013, 08:11 AM
  5. Read and update a field in another table.
    By Artist.Anon in forum Programming
    Replies: 2
    Last Post: 08-28-2012, 06:56 AM

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