Report based on parameter query

Mike Hughes

Registered User.
Local time
Today, 09:49
Joined
Mar 23, 2002
Messages
493
I have a report based on a parameter query. The query returns records from a date range. This query is based on two other parameter queries, each containing the same date range parameters. So, when I generate my report, I am first asked “enter start date” and “enter end date” and then I’m asked to “enter start date” and “enter end date” again! How do I make the prompt only appear once?
 
Enter the Parameters via a form, keep the form open while the report is opening
 
Rich said:
Enter the Parameters via a form, keep the form open while the report is opening

Is it possible to store the values from the from as variables in code rather than referencing them from the forms? I've got the same concept as the original poster, I've got a report based on a parameter query (but I need those values for other purposes as well).

What I would like to do is have the form accept the parameter values and somehow pass them to the parameter query and open the report. I can do this if it's only to run a parameter query using the ADO connection, command and parameter objects but I don't know if it's possible to open a report based on a parameter query in this situation.

.CommandText = qryWhatever
Set param = cmd.CreateParameter("Param Name", adInteger, adParamInput, 0, 0)
.Parameters.Append param
.Execute

I believe that the solution you suggest is to have the parameters from the query point to text boxes on the forms. I think that another solution would be for the params to reference a function to obtain a value but I would really like to know if the manner in which I want to do this is possible. Thanks.
 

Users who are viewing this thread

Back
Top Bottom