Uncochen
asked on
Runtime error '3061': Too few Parameters. Expected 3
[qryEditNewSummary] is a Query, If change the [qryEditNewSummary] to a "Table" , It work ok, no error. but if change to any Query, it will have runtime error 3601.
I have check the query name, and field name, everything is ok.
What 's wrong with query in dao??
I have check the query name, and field name, everything is ok.
What 's wrong with query in dao??
Private Sub cmdRandom_Click()
Dim dbs As Database
Dim rst As Recordset
Set dbs = CurrentDb
strSQL = "Select Total From [qryEditNewSummary]"
Set rst = dbs.OpenRecordset(strSQL, dbOpenDynaset)
MsgBox rst!Total
End Sub
In fact you probably also need to specify where 'Total' comes from.
Private Sub cmdRandom_Click()
Dim dbs As Database
Dim rst As Recordset
Set dbs = CurrentDb
strSQL = "Select qryEditNewSummary.Total From qryEditNewSummary"
Set rst = dbs.OpenRecordset(strSQL, dbOpenDynaset)
MsgBox rst!Total
End Sub
This error can also occur when the query requires additional input parameters. I believe that you can specify those using something like the following:
dbs.Parameters![SpecialParm] = "SomeValue"
dbs.Parameters![AnotherParm] = "SomeValue"
Uncochen,
Can you post the SQL for:
qryEditNewSummary
... so we don't have to guess at what the problem is?
JeffCoachman
Can you post the SQL for:
qryEditNewSummary
... so we don't have to guess at what the problem is?
JeffCoachman
ASKER
I try to make a new access file and run, it work Ok!!!
the ado and query no this problem. I don't kown what reason the old file will happen the problem??? I did try to greate a new query in the old file, still problem!!
the ado and query no this problem. I don't kown what reason the old file will happen the problem??? I did try to greate a new query in the old file, still problem!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window