Results 1 to 2 of 2
  1. #1
    database_1 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Mar 2020
    Posts
    34

    Having trouble using an UPDATE command


    I am attempting to change a ID in a table from a value taken from a form. I was able to turn both the original ID and the new ID into variables. These output values have been checked using a message box. I then have the code, CurrentDb.Execute "UPDATE [TRNG_MNGM] SET [TRNG_ID] = new_id WHERE [TRNG_ID] = old_id". By doing this, I get a run-time error 3061. It says there are too few parameters, expected 2. I have tried trouble shooting a couple different things but nothing has worked. If anyone could point me in the right direction, it would be greatly appreciated.

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    try

    CurrentDb.Execute "UPDATE [TRNG_MNGM] SET [TRNG_ID] = " & new_id & " WHERE [TRNG_ID] = " & old_id

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

Similar Threads

  1. Trouble running a Currentdb.Execute Command
    By DaKetch in forum Access
    Replies: 9
    Last Post: 03-18-2019, 10:08 AM
  2. Trouble with open form command
    By Evans2 in forum Access
    Replies: 4
    Last Post: 08-30-2017, 09:34 AM
  3. Trouble with using a form to update a table
    By Access_Novice in forum Forms
    Replies: 4
    Last Post: 10-27-2013, 08:59 PM
  4. Replies: 2
    Last Post: 08-30-2012, 07:59 AM
  5. Replies: 1
    Last Post: 07-15-2011, 05:24 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