A
akphidelt
Hi there, I'm currently in a jam. I created this big long code that works
perfectly until I enter a criteria in the query.
For example I have a form that has a control that is the end date of the
staff that needs to be allocated. So the criteria in the query looks like
Between Forms!Allocation!calStaffEnd - 6 And Forms!Allocation!calStaffEnd
When I put that in the query and run the code I get an error on line
Set rstStaff = MyDB.OpenRecordset("Send To Excel",dbOpenDynaset)
The error is Run-Time error 3061 Too few Parameters. Expected 1
I did some research on it and I've tried setting the Parameters by doing
something like this
Dim qdfStaff as DAO.QueryDef
Set qdfStaff = MyDB.QueryDefs("Send To Excel")
For Each prm In qdfStaff.Parameters
prm.Value = Eval(prm.Name)
Next
But I still get the same error message.
Any one have a clue on what I can do to run the query?
perfectly until I enter a criteria in the query.
For example I have a form that has a control that is the end date of the
staff that needs to be allocated. So the criteria in the query looks like
Between Forms!Allocation!calStaffEnd - 6 And Forms!Allocation!calStaffEnd
When I put that in the query and run the code I get an error on line
Set rstStaff = MyDB.OpenRecordset("Send To Excel",dbOpenDynaset)
The error is Run-Time error 3061 Too few Parameters. Expected 1
I did some research on it and I've tried setting the Parameters by doing
something like this
Dim qdfStaff as DAO.QueryDef
Set qdfStaff = MyDB.QueryDefs("Send To Excel")
For Each prm In qdfStaff.Parameters
prm.Value = Eval(prm.Name)
Next
But I still get the same error message.
Any one have a clue on what I can do to run the query?