Results 1 to 10 of 10
  1. #1
    Bentley is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    50

    Update Query

    Hello,

    I am trying to update a blank field from a field in a table that is linked to a spreadsheet. I believe I setup the query correctly. I have the two tables joined, I have the destination location set in the Field and Table parts of the query and in the Update To: row, I have the source table and field. However when the query is run, I get a 0 updates. Both fields in each table are labeled the same. Any ideas as to what I am doing incorrectly?

    thanks,

    Ben

  2. #2
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    > I am trying to update a blank field from a field in a table that is linked to a spreadsheet.

    Are you saying you created a LINK to an EXTERNAL Excel file? If so, linked Excel files are not updateable within Access, that I know of.

  3. #3
    Bentley is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    50
    Yes, we had to link the spreadsheet to get the information into access. However, I need the WO field to be duplicated into another table in order to use the lookups and combo boxes. Any ideas?

  4. #4
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    If you need to modify the data then you will need to write a query that SELECTs the records from the linked-Excel sheet and INSERT them into your Access table - then you can modify the data.

  5. #5
    Bentley is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    50
    Correct, but how do you insert? I guess that is my actual question. I am stumped on how to get that to work.

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Have you see this on Append queries?
    http://www.w3schools.com/sql/sql_insert.asp

  7. #7
    Bentley is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    50
    an insert isn't what I am after I don't believe. Essentially I need the work order field from the linked table from excel to be placed into my work order audit table so my forms and lookups work.

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    And that record already exists in work order audit table???

    You want to transfer data from a linked Excel spreadsheet to an Access table?
    Your query options are "UPDATE" (an existing field) or "APPEND" (Insert Into - this adds a new record).

    Even with VBA, you still must either update an existing record or add a new record.

  9. #9
    Bentley is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    50
    I need to transfer the work order field from the linked excel table to a field in a different table. I am having trouble with the update and append query as neither seem to update the audit table as I get a "0 row(s) will be updated".

  10. #10
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    See if you can create a Select query to return the work order data from the linked spreadsheet in Access. If you can, and include whatever fields you will require at the Update stage, you're halfway there. You might be able to convert the Select query to an Update.

    I get the impression from reading replies that there might be some confusion about updating versus appending. You can't update a record that doesn't exist, so let's be sure which it is you need. Sometimes, it's necessary to append a record, then from a source that couldn't be involved in the original append, you perform the update on the newly appended record in a different query. You might have to post some data that resembles the original tables and records you are trying to affect, and the sql statement you're using to attempt that.
    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. Replies: 1
    Last Post: 10-27-2016, 12:14 PM
  2. Replies: 14
    Last Post: 08-12-2014, 06:33 AM
  3. Replies: 7
    Last Post: 08-26-2013, 06:05 AM
  4. Replies: 2
    Last Post: 08-30-2012, 07:59 AM
  5. Replies: 4
    Last Post: 11-10-2011, 03:41 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