Help with OpenReport Where Condition

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I created a macro that does the following:
OpenReport
Report A
in Print Preview
PrintOut
Selection
3 copies
OpenReport
PDF Report
Print

My reports are identical with the exception of PDF Report that has the Adobe
Driver assigned as its default printer. Both reports call from the same
query with a parameter on Report #. What I wish to do is create a condition
for the 2nd occurance of OpenReport that will maintain the parameter selected
from the 1st go around of the query. I assume it would go into the where
condition, how can this be done?

Thank you,

S
 
S,

Don't use a Parameter Query for this. Use an unbound textbox on a form
for the entry of the Report Number criteria, and then reference this in
the Criteria of the query, in the place of your existing parameter
prompt, using syntax such as...
[Forms]![NameOfForm]![NameOfTextbox]

By the way, as an aside, if you mean you have a field named Report #, it
is not a good idea to use a # as part of the name of a field or control.
 
Thanks, that did the trick.

Steve Schapel said:
S,

Don't use a Parameter Query for this. Use an unbound textbox on a form
for the entry of the Report Number criteria, and then reference this in
the Criteria of the query, in the place of your existing parameter
prompt, using syntax such as...
[Forms]![NameOfForm]![NameOfTextbox]

By the way, as an aside, if you mean you have a field named Report #, it
is not a good idea to use a # as part of the name of a field or control.

--
Steve Schapel, Microsoft Access MVP

busy said:
I created a macro that does the following:
OpenReport
Report A
in Print Preview
PrintOut
Selection
3 copies
OpenReport
PDF Report
Print

My reports are identical with the exception of PDF Report that has the Adobe
Driver assigned as its default printer. Both reports call from the same
query with a parameter on Report #. What I wish to do is create a condition
for the 2nd occurance of OpenReport that will maintain the parameter selected
from the 1st go around of the query. I assume it would go into the where
condition, how can this be done?

Thank you,

S
 
Back
Top