Specify parameters

  • Thread starter Thread starter Jesse Aviles
  • Start date Start date
J

Jesse Aviles

I have a report that is based on a query with parameters. Parameters are of
the date type. However, I can type any date regardless of the order. I
have a form that checks the date "correctness" that I would like to use to
call the report. Can I specify the parameters of teh query programatically,
that is, when I call the report, can I supply the parameters
programatically?
 
Jesse said:
I have a report that is based on a query with parameters. Parameters are of
the date type. However, I can type any date regardless of the order. I
have a form that checks the date "correctness" that I would like to use to
call the report. Can I specify the parameters of teh query programatically,
that is, when I call the report, can I supply the parameters
programatically?


Yes, use a form with a button to open the report. The code
in the button's Click event can supply the parameters to the
query in (hidden?) text boxes on the form or, if the
parameters are just used to filter the report's data, you
can use the OpenReport method's WhereCondition argument
instead of query parameters.
 
Thank you Mr. Barton. I wanted to see if I can include the parameter
information programatically because I have a text box that use the parameter
information. What I'll do is that I'll include the information in the
OpenArgs and fill the text box programatically and filter the report using
the WhereCondition.
 
Jesse said:
Thank you Mr. Barton. I wanted to see if I can include the parameter
information programatically because I have a text box that use the parameter
information. What I'll do is that I'll include the information in the
OpenArgs and fill the text box programatically and filter the report using
the WhereCondition.


OpenArgs? Are there two forms involved with this?

If you're wanting to display the parameter value in a
report text box, then this is ok, but you could also use an
expression in the text box that refers back to the form
=Forms!theform.textboxonform
But OpenArgs is better if there's a chance that the report
will be opened from more than one form. A little more code
but more versatile.
 
Back
Top