Select Specific Report

B

Bill

Hi,

I'm setting three queries that have pop-up "Enter Parameter Value". I
don't understand and not sure if it's right when I create Command Button
"Preview" that has few "DoCmd.OpenReport... "Report Name" but it kept pop-up
by three times. Each query has their own report. I don't want to see pop
up three times when I select one report and related to the query so I can
get one POP-UP than three times...

I need you help if there is another way to do this.

YOur help would be much appreciated.

Thanks,
 
M

Marshall Barton

Bill said:
I'm setting three queries that have pop-up "Enter Parameter Value". I
don't understand and not sure if it's right when I create Command Button
"Preview" that has few "DoCmd.OpenReport... "Report Name" but it kept pop-up
by three times. Each query has their own report. I don't want to see pop
up three times when I select one report and related to the query so I can
get one POP-UP than three times...


Instead of using a pop-up prompt for the query paramter, use
a text box on the form where the users can enter the
parameter value. Then the queries can use a parameter of
the form:
Forms!yourform.the textbox.

If you're using the query parameter to filter the data for
the reports, you can get rid of the parameter in query and
use the OpenReport method's WhereCondition argument:

DoCms.OpenReport "reportname", acViewPreview, , _
"numericfield = " & numbervariable
or

DoCms.OpenReport "reportname", acViewPreview, , _
"textfield = """ & stringvariable & """"
 
M

Mingqing Cheng [MSFT]

Hi Bill,

I haven't heard back from you yet and I'm just writing in to see if you
have had an opportunity to try Marshall Barton's suggestion.

If you have any difficulties or concerns, please feel free to post here. I
look forward to hearing from you.


Thank you for your patience and cooperation.

Sincerely yours,

Mingqing Cheng
Microsoft Online Support
 

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