Results 1 to 5 of 5
  1. #1
    Nikh is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2016
    Posts
    19

    Run Time Error : 3061 - Too Few Parameters , Expected 13.


    Hi...

    I am getting error while inserting data into table using below query....

    Run Time Error : 3061 - Too Few Parameters , Expected 13.

    ssql = "INSERT INTO TestDataEntry(B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,B11,B 12,B13,B14,B15,B16,B17,B18,B19,B20,B21,B22,B23,B24 ,B25,B26,B27,B28,B29,B30,B31,B32,B33,B34,B35,B36,B 37,B38,B39,B40,B41,B42,B43,B44,B45,B46,B47,B48)"
    ssql = ssql & "VALUES(" & A1 & "," & A2 & "," & A3 & "," & A4 & "," & A5 & "," & A6 & "," & A7 & "," & A8 & "," & A9 & "," & A10 & "," & A11 & "," & A12 & ",""" & A13 & """," & A14 & "," & A15 & "," & A16 & "," & A17 & "," & A18 & "," & A19 & "," & A20 & "," & A21 & "," & A22 & "," & A23 & "," & A24 & "," & A25 & "," & A26 & "," & A27 & "," & A28 & "," & A29 & "," & A30 & "," & A31 & ",""" & A32 & """," & A33 & "," & A34 & "," & A35 & "," & A36 & "," & A37 & ",""" & A38 & """," & A39 & "," & A40 & "," & A41 & "," & A42 & "," & A43 & ",""" & A44 & """,""" & A45 & """," & A46 & "," & A47 & "," & A48 & ")"

    Debug.Print ssql
    CurrentDb.Execute ssql

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    One thing (I don't know if it is the only issue), but you need space just before "VALUES...". You build the first part of the string, then add the second part, but have not included a space between the two.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Instead of using the dbl-quote for strings, use single quote....

    & "'" & X4 & "','" & X5 & "'"

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    ssql = "INSERT INTO TestDataEntry("
    ssql = ssql & "B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,"
    ssql = ssql & "B11,B12,B13,B14,B15,B16,B17,B18,B19,B20,"
    ssql = ssql & "B21,B22,B23,B24,B25,B26,B27,B28,B29,B30,"
    ssql = ssql & "B31,B32,B33,B34,B35,B36,B37,B38,B39,B40,"
    ssql = ssql & "B41,B42,B43,B44,B45,B46,B47,B48"
    ssql = ssql & ") VALUES ("
    ssql = ssql & A1 & "," & A2 & "," & A3 & "," & A4 & "," & A5 & "," & A6 & "," & A7 & "," & A8 & "," & A9 & "," & A10 & ","
    ssql = ssql & A11 & "," & A12 & ",""" & A13 & """," & A14 & "," & A15 & "," & A16 & "," & A17 & "," & A18 & "," & A19 & "," & A20 & ","
    ssql = ssql & A21 & "," & A22 & "," & A23 & "," & A24 & "," & A25 & "," & A26 & "," & A27 & "," & A28 & "," & A29 & "," & A30 & ","
    ssql = ssql & A31 & ",""" & A32 & """," & A33 & "," & A34 & "," & A35 & "," & A36 & "," & A37 & ",""" & A38 & """," & A39 & ","
    ssql = ssql & A40 & "," & A41 & "," & A42 & "," & A43 & ",""" & A44 & """,""" & A45 & """," & A46 & "," & A47 & "," & A48 & ")"

    There were some extra spaces in your original string and you did not have spaces before and after your VALUES statement which would cause some problems.

    In this string values Field B13, B32, B38, B44, B45 are all text
    The remaining fields are all numeric

    Is that how your field 'testDataEntry' is set up?

    Is this your entire string? Usually you get that 'too few parameters' message when Access can't interpret a criteria or value in your query and you may need to make them parameter values.

    EDIT: check your table field name values, it could also be a problem with naming.

  5. #5
    Nikh is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2016
    Posts
    19
    Thanks,

    Working Right ! Thank You

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

Similar Threads

  1. Replies: 5
    Last Post: 03-27-2015, 03:42 PM
  2. Error 3061. Too few parameters. Expected 1.
    By Glenn_Suggs in forum Programming
    Replies: 5
    Last Post: 02-03-2015, 12:03 PM
  3. Replies: 3
    Last Post: 04-26-2013, 01:37 PM
  4. 3061 Error. Too few parameters. Expected 1.
    By rghollenbeck in forum Queries
    Replies: 5
    Last Post: 09-28-2011, 12:12 PM
  5. Replies: 1
    Last Post: 05-21-2011, 01:33 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