Results 1 to 6 of 6
  1. #1
    Paul-NYS is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    6

    Access update query not working

    Hi


    I created two versions of the below Access query to update a field based on matching two fields from the table the update field is in against two columns in another table. I am getting an errors in both instances that prevent me from running it. Any ideas?

    Paul


    update local
    set RegistrationID = oracle.MEDIATOR_ID
    from local, oracle
    where local.FirstName = oracle.FIRST_NAME and local.LastName = oracle.LAST_NAME;


    update local
    set RegistrationID =
    (select oracle.MEDIATOR_ID from oracle
    where local.FirstName = oracle.FIRST_NAME and local.LastName = oracle.LAST_NAME);

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    What is the error message? Might need JOIN clause linking the tables.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Paul-NYS is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    6
    Errors indicated below:

    1. UPDATE [local]
    SET RegistrationID =
    (select oracle.MEDIATOR_ID from oracle
    where local.FirstName = oracle.FIRST_NAME and local.LastName = oracle.LAST_NAME);

    The error is 'operation must use an updateable query'.

    2. update local
    set RegistrationID = oracle.MEDIATOR_ID
    from local, oracle
    where local.FirstName = oracle.FIRST_NAME and local.LastName = oracle.LAST_NAME;

    Error is "syntax error (missing operator) in query expression 'oracle.MEDIATOR_ID from local'"

    Paul

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Did you try creating tables join link in the query?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Paul-NYS is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    6
    The original query was set up for 2 tables and did not come with a join (apparently worked that way), so I did not add it and am not totally sure of the syntax, to be honest. I am not at the PC with the database right now, so I cannot attempt it, but where would the join go?

    Paul

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Query in design view, click and hold on key field in one table and drag cursor to key field in other table. Double click on the resulting line to open dialog. Set Jointype.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Update query only working on some records
    By JackieEVSC in forum Queries
    Replies: 3
    Last Post: 11-21-2011, 10:31 AM
  2. Update not working in access
    By johnmerlino in forum Access
    Replies: 1
    Last Post: 10-10-2010, 06:00 PM
  3. Update Inner Joing Query not working??
    By snowmman99 in forum Access
    Replies: 2
    Last Post: 09-08-2010, 12:15 PM
  4. Replies: 2
    Last Post: 06-14-2010, 09:38 PM
  5. IIf Update Query working OK but a better way?
    By dreamweaver547 in forum Queries
    Replies: 7
    Last Post: 04-19-2010, 09:47 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