I have a parameter query named "qry_employee_info_reports" that I need
to run in the OnOpen event of a form. I'm after its total number of
records. The query's got several joins in it, and one of them is to
query "qry_last_transition," which is also a parameter query. Both
querys use the same parameter: a control called "txtSecondDate" on a
pop up form.
What I've been trying to do up to this point is to open up this
parameter form, set the date of "txtSecondDate" to the appropriate
date, and then use the CurrentDB.OpenRecordset method like this: Set
GetEmployeeCount =
CurrentDB.OpenRecordset("qry_employee_info_reports "). I've tried using
different types like dbOpenForwardOnly, etc. as well. No matter what I
try though, i keep getting the "Too few parameters. Expected 1."
error; I suspect because of "qry_last_transition."
My questions are then first, how can I run this query in code to get
its total number of records; and second, how is what I'm doing here any
different then when I run a report based on this query? When I run a
report, whatever needs the parameter just looks at the parameter form
and gets it, right? Why wouldn't this be the same thing?
Any help is greatly appreciated.
-Josh Nikle