programming report parameter

  • Thread starter Thread starter wba
  • Start date Start date
W

wba

Hi all,

I have a report based on a parameter query, asking for
three parameters. The first two are dBeginDate and
dEndDate and the third one is strString. The report is
to be called six times, with a different value for
strString, the dates remaining the same.

The parameter query works fine, and so does the report.

I want to call the report from within a program, so that
I do not have to retype the parameters, but how do I get
the parameters in the docmd.open report ?

Thanks for your help,

W
 
Are the parameters being stored on a form?
If yes, add a text box control to the report and reference the control on
the form
hth
 
wba said:
I have a report based on a parameter query, asking for
three parameters. The first two are dBeginDate and
dEndDate and the third one is strString. The report is
to be called six times, with a different value for
strString, the dates remaining the same.

The parameter query works fine, and so does the report.

I want to call the report from within a program, so that
I do not have to retype the parameters, but how do I get
the parameters in the docmd.open report ?


The standard approach to this kind of thing is to use a form
with text boxes for the parameter values and a button to
initiate printing the report.

The query parameters would then be like:
Forms!theformname.textboxname

You may have some difficulty executing OpenReport multiple
times on the same report as well as making sure that the
parameter text boxes do not change until the report is
finished using them. If you are printing the report, then
check SysCmd in Help to tell you if the report is still open
before opening it again. If you're previewing the report,
you should expect to wait for the user to close one preview
before you open another.
 
Back
Top