GulfImages
Technical User
Hi all,
I have a piece of code that I'm just stumped with:
Dim OrdIn As Database, Invoice As Recordset
Set OrdIn = DBEngine.Workspaces(0).Databases(0)
Set Invoice = OrdIn.OpenRecordset("qryInvByDate", dbOpenDynaset)
The qryInvByDate is a simple query with 2 fields, the date field has criteria of between Forms!frmName!FldName1 and Forms!frmName!FldName2. When I view the query with the form open, it works perfectly, when I try to run the code above, I get and error 3061 "Too few parameters, expected 2". I have no parameters in the query.
Any suggestions?
Thanks,
BobbyC
I have a piece of code that I'm just stumped with:
Dim OrdIn As Database, Invoice As Recordset
Set OrdIn = DBEngine.Workspaces(0).Databases(0)
Set Invoice = OrdIn.OpenRecordset("qryInvByDate", dbOpenDynaset)
The qryInvByDate is a simple query with 2 fields, the date field has criteria of between Forms!frmName!FldName1 and Forms!frmName!FldName2. When I view the query with the form open, it works perfectly, when I try to run the code above, I get and error 3061 "Too few parameters, expected 2". I have no parameters in the query.
Any suggestions?
Thanks,
BobbyC