S
Scott F via AccessMonster.com
I am making an app more user friendly. Rather than have the user enter
multiple parameters, many times, I placed text boxes on the form and use
these to provide start and end dates to the queries.
So, I removed the parameters from the query. (Note: Actually it is 2
queries as one is embedded in the other. But I removed the parameters from
both queries.)
A button runs this code:
Set qdf = db.QueryDefs("qry_Error Check_Missing Start or End")
'qdf![Data Export Begin Date] = Forms!frmBilling!txtStartDate
'qdf![Data Export End Date] = Forms!frmBilling!txtEndDate
Set rs = qdf.OpenRecordset
I commented out the lines setting the parameters, but when the code runs, I
get a "Too few parameters, 2 expected" error. (Wait, I removed the
parameters!)
If I uncomment the two lines to set the parameters, I get a "Item not found
in this collection." (Probably because I removed the parameters!)
A compact and repair does not solve the problem. Also, if I run the query
manually from the database window with the "frmBilling" form open and the
date fields populated, it runs fine.
What a I missing?
Thanks,
Scott
multiple parameters, many times, I placed text boxes on the form and use
these to provide start and end dates to the queries.
So, I removed the parameters from the query. (Note: Actually it is 2
queries as one is embedded in the other. But I removed the parameters from
both queries.)
A button runs this code:
Set qdf = db.QueryDefs("qry_Error Check_Missing Start or End")
'qdf![Data Export Begin Date] = Forms!frmBilling!txtStartDate
'qdf![Data Export End Date] = Forms!frmBilling!txtEndDate
Set rs = qdf.OpenRecordset
I commented out the lines setting the parameters, but when the code runs, I
get a "Too few parameters, 2 expected" error. (Wait, I removed the
parameters!)
If I uncomment the two lines to set the parameters, I get a "Item not found
in this collection." (Probably because I removed the parameters!)
A compact and repair does not solve the problem. Also, if I run the query
manually from the database window with the "frmBilling" form open and the
date fields populated, it runs fine.
What a I missing?
Thanks,
Scott