Results 1 to 3 of 3
  1. #1
    Monterey_Manzer is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    164

    UPDATE Query Too Few Parameters


    Hi Everyone,

    I've seen a few posts on this topic but all of them had some other error that I could spot. This one is still baffling me. I have a table in my Access dBase that puts out a report which gets exported to Excel because that's how my supervisor likes to deal with it. She then makes a series of final edits and wants to be able to simply hit a button and have the table in Access updated with the edits made in Excel. I've got most of this coded alright. Where I'm train-wrecking is the UPDATE query. Every time I run it I get Run-time error '3061' Too few parameters. Expected 12. The code is below:
    Code:
    strSQL = "UPDATE IssLog SET IssLog.IssAddDate = [IssLogUpdate].[IssDateAdd], IssLog.IssSum = [IssLogUpdate].[IssSum]," & _
                 " IssLog.IssTyp = [IssLogUpdate].[IssTyp], IssLog.IssDetails = [IssLogUpdate].[IssDetails]," & _
                 " IssLog.FUpDate = [IssLogUpdate].[FUpDate], IssLog.SecNotes = [IssLogUpdate].[SecNotes]," & _
                 " IssLog.SMNotes = [IssLogUpdate].[SMNotes], IssLog.DSPQ = [IssLogUpdate].[DSPQ]," & _
                 " IssLog.lAction = [IssLogUpdate].[lAction], IssLog.lNotes = [IssLogUpdate].[lNotes]," & _
                 " IssLog.meetDis = [IssLogUpdate].[meetDis]" & _
                 " WHERE ((IssLog.ID=IssLogUpdate.ID));"
    
    CurrentDb.Execute(strSQL)
    Unlike others with this problem, I'm not trying to use any variables based on Form controls. I just want to apply the updates to records where ID numbers match. I have a very similar update query as part of my general dBase record updating protocol and I execute it every morning without fail. I have no idea why this isn't working. If someone could help me spot the problem i would be most appreciative.

    Thanks!
    Ryan

  2. #2
    Monterey_Manzer is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    164
    Quick update:

    I modified my SQL statement lightly. Now I get the same error except that Access tells me I am missing 1 parameter instead of 12. I guess that's an improvement. The updated code is below:

    Code:
    strSQL = "UPDATE IssLogUpdate INNER JOIN IssLog ON IssLogUpdate.ID = IssLog.ID" & _
                 " SET IssLog.IssAddDate = [IssLogUpdate].[IssDateAdd], IssLog.IssSum = [IssLogUpdate].[IssSum]," & _
                 " IssLog.IssTyp = [IssLogUpdate].[IssTyp], IssLog.IssDetails = [IssLogUpdate].[IssDetails]," & _
                 " IssLog.FUpDate = [IssLogUpdate].[FUpDate], IssLog.SecNotes = [IssLogUpdate].[SecNotes]," & _
                 " IssLog.SMNotes = [IssLogUpdate].[SMNotes], IssLog.DSPQ = [IssLogUpdate].[DSPQ]," & _
                 " IssLog.lAction = [IssLogUpdate].[lAction], IssLog.lNotes = [IssLogUpdate].[lNotes]," & _
                 " IssLog.meetDis = [IssLogUpdate].[meetDis]" & _
                 " WHERE ((IssLog.ID=IssLogUpdate.ID));"
                
        Debug.Print strSQL
        CurrentDb.Execute (strSQL)
        MsgBox "Update query on Issues Log executed", vbInformation, "Issue Log Updated"
    It seems that Access wants me to provide some ID numbers. I don't understand this as the purpose of this query is to match records via the ID number. I'm really beating my head against a wall on this one.

  3. #3
    Monterey_Manzer is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    164
    Well now I feel like an idiot. One field was slightly misspelled and getting that straight cleared things right up. Sorry if I wasted anyone's time.

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

Similar Threads

  1. Update more queries with the same parameters
    By Christian1977 in forum Programming
    Replies: 4
    Last Post: 06-28-2013, 02:57 AM
  2. Passage of parameters - Form Update
    By altotoe in forum Programming
    Replies: 2
    Last Post: 04-19-2013, 04:19 AM
  3. UPDATE function "too few parameters"
    By eww in forum Programming
    Replies: 5
    Last Post: 05-11-2011, 09:38 AM
  4. Too Few Parameters - UPDATE SQL
    By jgelpi16 in forum Programming
    Replies: 3
    Last Post: 09-20-2010, 10:11 AM
  5. Replies: 3
    Last Post: 07-01-2010, 07:55 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