Results 1 to 6 of 6
  1. #1
    JimG is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    4

    db.Execute Error 3061

    Hi,



    Hoping someone can help an ole mainframer out Trying to get this working in an existing application the users developed. I can't seem to get this command to work. It looks like Access doesn't like the string that I'm feeding the db.execute statement - like its coded incorrectly so access doesn't see it as a valid argument to the command. Help !!!

    Here is the code on the delete button:

    Dim SiteCdDel As String

    SiteCdDel = Me![frmSite]![SiteCode].Value

    SQL1 = "Delete * FROM tblSwitch_Mod Where " & _
    "(SiteCD = '" & SiteCdDel & "');"

    db.Execute SQL1


    Here is what it looks like in the debugger
    "Delete * FROM tblSwitch_Mod Where (SiteCD = 'APTW');"


    Table definition for this column
    SiteCD type text


    Result

    Run Time Error 3061 to few parameters. Expected 1


    I've tried re-working the command but no matter what I seem to get that error. Thanks for any advice/help you can provide - I'm stuck !!!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try brackets:
    "([SiteCD] = '" & SiteCdDel & "');"

  3. #3
    JimG is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    4
    hmmm.... I tried this and I still got the same error.

    how it looked in debugger:

    "Delete * FROM tblSwitch_Mod Where ([SiteCD] = 'CVHD');"

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    That error usually means something is not spelled correctly. I know you have checked that but maybe just one more time.

  5. #5
    JimG is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    4
    That Was it ! SiteCD should have been Site_CD. I knew it was going to be something like that. Thanks Again for the help - I'm happy !!!

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Excellent! Glad we could help Jim.

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

Similar Threads

  1. Can't get any of my code to execute!
    By blacksaibot in forum Programming
    Replies: 4
    Last Post: 03-16-2010, 08:08 AM
  2. Can a report execute generate a file
    By techexpressinc in forum Reports
    Replies: 7
    Last Post: 01-16-2010, 04:03 AM
  3. Error 3061 in VBA program
    By fbou in forum Programming
    Replies: 5
    Last Post: 10-07-2009, 11:00 AM
  4. Error 3061
    By Shanks in forum Queries
    Replies: 4
    Last Post: 09-16-2009, 07:13 AM
  5. Execute Command Interactively
    By zephaneas in forum Programming
    Replies: 1
    Last Post: 11-08-2008, 09:56 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