Help with OpenReport Where Condition

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

Steve Schapel

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.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top