Click to See Complete Forum and Search --> : QueryDef and Data Control


carolineon
September 25th, 2001, 10:38 PM
I used a QueryDef to retrieve data from database. The problem is when I refresh the data control, there's an error "Run time error '3061'. Too few parameters. Expected 2"

My codes is as below :
Set qryDate = dbNew.QueryDefs("queries_name")
qryDate.Parameters("parameter1") = value1
qryDate.Parameters("parameter2") = value2
Set recSocket = qryDate.OpenRecordset()
Set DataControl.Recordset = recSocket
DataControl.Refresh

But if I don't refresh it, I can't control the records ( up and down ) in the grid using the data control.

Hope someone can help. Thank you.