Results 1 to 2 of 2
  1. #1
    TheLazyEngineer is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    2

    Run-time error '3061'

    So I got some help here before for a runtime error that I was getting, well I'm back... now with a different error, after fixing a few others ones. I have no idea what this means. HELP please.

    I have attached the actual access file if you would like to open it and check it out. The problem is with the "add" button, that adds the data I input into the table below it.Click image for larger version. 

Name:	Untitled.jpg 
Views:	9 
Size:	65.5 KB 
ID:	19915
    The error reads as you can see.
    "Run-time error '3061':
    Too few parameters. Expected 1."
    Here is the code:
    --------------------------------------------------------------------------

    Private Sub cmdAdd_Click()
    'add data to table
    CurrentDb.Execute "INSERT INTO PROGRAM(programid, robotnumber, robot, box, options, origrom, [date], disk, customer) VALUES (" & Me.txtNumber & ",'" & Me.txtRobot & "','" & _
    Me.txtBox & "', '" & Me.txtOptions & "', '" & Me.txtID & "', '" & Me.txtRom & "', '" & Me.txtDate & _
    "', '" & Me.txtDisk & "', '" & Me.txtCustomer & "')"
    'refresh data in list on form
    frmProgramSub.Form.Requery

    End Sub

    Private Sub cmdClear_Click()
    Me.txtNumber = ""
    Me.txtRobot = ""
    Me.txtBox = ""
    Me.txtOptions = ""
    Me.txtRom = ""
    Me.txtDisk = ""
    Me.txtCustomer = ""
    Me.txtDate = ""



    Me.txtID.SetFocus
    End Sub

    Private Sub cmdClose_Click()
    DoCmd.Close

    End Sub

    --------------------------------------------------------------------------
    Here is the attached file. Any help would be appreciated. Thanks.
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    When opening frmProgram, there are a bunch of popup prompts - the subform is not finding fields the controls reference. Why are form and subform bound to the same data? Maybe you should consider Split Form object.

    These are bound forms. Why are you using code to insert a record? If you set the controls to "" then you are changing data in the current record.


    Advise not to use spaces and special characters/punctuation (underscore is exception) in naming convention. Also, don't use reserved words as names - Date is a reserved word.
    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. Run time error 3061
    By beaurou in forum Modules
    Replies: 18
    Last Post: 02-23-2015, 11:54 AM
  2. run time error-3061 too few parameters.
    By pervej.fac in forum Queries
    Replies: 1
    Last Post: 01-04-2014, 05:32 AM
  3. Run-Time Error 3061
    By GraeagleBill in forum Programming
    Replies: 2
    Last Post: 09-23-2013, 06:46 AM
  4. Run-time error 3061
    By boywonder in forum Programming
    Replies: 1
    Last Post: 07-20-2011, 06:14 AM
  5. Run-Time error 3061
    By boywonder in forum Programming
    Replies: 12
    Last Post: 05-24-2011, 10:15 AM

Tags for this Thread

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