Results 1 to 8 of 8
  1. #1
    emarchant is offline Novice
    Windows 7 Access 2007
    Join Date
    Oct 2010
    Posts
    12

    Problem with Update Query?

    I have an update query in my macro to update a field in my form. The macro runs a Make Table query, so that the data in my query is stored in a temporary table, then runs the update query to put the temp table data into my form/permanent table. Here is the trouble:

    When my update query runs, it returns zeroes..... the data is all there, it should be updating to percentages... I am not sure how to troubleshoot!

    Here is the code:



    UPDATE tblExecutionTracking LEFT JOIN tblPercentage ON (tblExecutionTracking.[Entry #] = tblPercentage.[Entry #]) AND (tblExecutionTracking.[BU / Project] = tblPercentage.[BU / Project]) SET tblExecutionTracking.[BU %] = [tblPercentage]![SumOfRatio];

    The data matches... but it updates everything to zero!?!

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    UPDATE tblExecutionTracking LEFT JOIN tblPercentage ON (tblExecutionTracking.[Entry #] = tblPercentage.[Entry #]) AND (tblExecutionTracking.[BU / Project] = tblPercentage.[BU / Project]) SET tblExecutionTracking.[BU %] = [tblPercentage]![SumOfRatio];

    can you try to change the "!" to "."?

  3. #3
    emarchant is offline Novice
    Windows 7 Access 2007
    Join Date
    Oct 2010
    Posts
    12
    No, that did not work... it is so strange. The data is in my temp table, all the field types match... but it updates everything to a zero!

  4. #4
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    I don't think they match.

    try to change left join to inner join, then you will know how many records match.

  5. #5
    emarchant is offline Novice
    Windows 7 Access 2007
    Join Date
    Oct 2010
    Posts
    12
    Okay, I did that... I am getting the same result. I am guessing that means that something does not match... but I don't understand what! I have looked at all the fields in both of the temp table and the table I am trying to update... everything looks the same...... what else am I missing?

  6. #6
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    change to a select query then you will see:

    select [tblPercentage].[SumOfRatio], tblExecutionTracking.* inner JOIN tblPercentage ON (tblExecutionTracking.[Entry #] = tblPercentage.[Entry #]) AND (tblExecutionTracking.[BU / Project] = tblPercentage.[BU / Project])



  7. #7
    emarchant is offline Novice
    Windows 7 Access 2007
    Join Date
    Oct 2010
    Posts
    12
    SELECT tblExecutionTracking.[Entry #], tblExecutionTracking.[BU / Project]
    FROM tblExecutionTracking INNER JOIN tblPercentage ON (tblExecutionTracking.[BU / Project] = tblPercentage.[BU / Project]) AND (tblExecutionTracking.[Entry #] = tblPercentage.[Entry #]);

    Returned all expected data; everything matches.

    ??

  8. #8
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    You must have looked at the wrong table

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

Similar Threads

  1. Update Query with parameter query
    By mimikate in forum Queries
    Replies: 2
    Last Post: 03-16-2010, 09:10 PM
  2. Update Query- selective update?
    By stephenaa5 in forum Queries
    Replies: 1
    Last Post: 10-29-2009, 11:15 AM
  3. query problem i have a problem wi
    By maxx3 in forum Queries
    Replies: 0
    Last Post: 06-29-2009, 02:29 AM
  4. Data Update Problem
    By Nosaj08 in forum Forms
    Replies: 3
    Last Post: 05-15-2009, 02:06 PM
  5. Update Query problem
    By sollem1 in forum Queries
    Replies: 0
    Last Post: 11-08-2007, 10:16 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