Results 1 to 4 of 4
  1. #1
    Bob M is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Mar 2013
    Posts
    43

    Explantion of error - too few parameters.Expected 1

    Hi again

    I have added some code to my program and currently get the above error on line

    d.Execute "UPDATE Table2 SET Table2.RecAdded=FALSE;",dbFailOnError



    Any help appreciated

    Bob M
    Dunedin
    New Zealand

    p.s. code and data attached
    Attached Files Attached Files

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    There is no RecAdded field in table2. More to come after I take a deeper look.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Your comments include "loop through j and c where j = 0 -> 9" If j is 0 then this will also fail
    Weights(j, c) = 1 - Abs((t2("PIC" & j)) - j) * DValues(c)
    because there is no PIC0 field in your recordset since the table has no PIC0 field.

    I used Find to look for SumWeights, which is declared at the procedure level. The next time I found it is in
    Sim = SumWeights * 10
    so since no value gets assigned to it, the calculation should be 0
    If you don't use the record count variable, why create it and assign a value?
    Not sure if you realize that everything on this line
    Dim i, j, c, TotalDiffs, BigDiffs, X, Y, Z, tmp, RecAdded As Integer
    is a variant execpt for RecAdded? You are using the variables in calculations, and if you realized this, you'd be expecting the possibility of all being Null (except for RecAdded) but you don't handle the possibility of Nulls. Thus I'm guessing.
    That's all for now, folks!

  4. #4
    Bob M is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Mar 2013
    Posts
    43
    Quote Originally Posted by Micron View Post
    Your comments include "loop through j and c where j = 0 -> 9" If j is 0 then this will also fail
    Weights(j, c) = 1 - Abs((t2("PIC" & j)) - j) * DValues(c)
    because there is no PIC0 field in your recordset since the table has no PIC0 field.

    I used Find to look for SumWeights, which is declared at the procedure level. The next time I found it is in
    Sim = SumWeights * 10
    so since no value gets assigned to it, the calculation should be 0
    If you don't use the record count variable, why create it and assign a value?
    Not sure if you realize that everything on this line
    Dim i, j, c, TotalDiffs, BigDiffs, X, Y, Z, tmp, RecAdded As Integer
    is a variant execpt for RecAdded? You are using the variables in calculations, and if you realized this, you'd be expecting the possibility of all being Null (except for RecAdded) but you don't handle the possibility of Nulls. Thus I'm guessing.
    That's all for now, folks!
    Hi Micron

    Many thanks for excellent feedback

    I shall address each of your comments and see how we go

    Bob M

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

Similar Threads

  1. error 3601 too few parameters, expected 1
    By JeroenMioch in forum Programming
    Replies: 6
    Last Post: 03-22-2016, 02:28 AM
  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. Error on too few parameters expected 3
    By haishuoBB in forum Programming
    Replies: 7
    Last Post: 02-27-2013, 03:26 PM
  5. 3061 Error. Too few parameters. Expected 1.
    By rghollenbeck in forum Queries
    Replies: 5
    Last Post: 09-28-2011, 12:12 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