Reports Macro

R

rdw1260

I have a form [View Grievance Reports] with several reports set to run by a
single macro [View Grievance Reports Macros]. The form [View Grievance
Reports] has an unbounded list box that uses a table [Grievance Reports
Table] as the row source type. The report based macro works perfectly. I’m
now trying to adapt this form and macro to open a specific query when I
either click or double click on the query listed on the form. I can get the
Query based macro to work if I enter each query for click and double click.
If a query is listed on the form and it is not entered in the macro the query
listed on the form will not open.

I know what is the difference between the actions [OpenQuery] and
[OpenReport]. The [OpenReport] action allows the Action Argument: Report
Name: =[Forms]![View Grievance Reports]![lstReports]. The [OpenQuery] allows
a single named query to open. Is there a way to adapt the report based macro
to work so that I can select a single query from the list of queries on a
form to open?

Thanks for any help.
 
S

Steve Schapel

Bob,

I am not aware of any such difference between the operation of the
OpenQuery and OpenReport actions. You should be able to reference the
form control in exactly the same way as you did for the listbox to
determine the report name.

Having said that, I am also bound to say that opening a query datasheet
during database operation is generally regarded as a bad idea. The
OpenQuery action should normally be reserved for running an action query
(e.g. Append, Update, Delete), rather than a Select Query. If you want
to show the data returned by a Select Query, you should make a form
using the query as the Record Source, and then use the OpenForm action
to open the form instead.
 

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