How can I bring up the "Create Report Wizard" from VBA?

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

Guest

We would like to add some structure to the Create Report wizard by executing
it from a button on a menu. How do I get it started from my VBA code behind?
 
The command button will need to have an "OnClick Event" that calls up the
report. The report must already be designed. The report can be based on a
parameter query which will present input boxes to be completed so the report
will run.

Without more information from you, this is as specific an answer that I can
offer.
 
Let me clarify

We want to use Ms Access reports and the Create Report Wizard to allow our
end users to do ad hoc reporting.

Since the Create Report Wizard really expects the base query to be already
created so that any joins or selection is already performed in the query, we
would like to allow the execute code from the button to create the query, (we
have that part figured out) then launch the provided Ms Access Create Report
Wizard.

If possible we would like to provide the base query name and the Report Name
to the wizard without the user typing these in, then allow user to go throgh
the rest of the wizard to create the complete report. But we can't find the
object name or method or whatever to get the standard Create Report Wizard to
come up.

Thanks anyway.
 
Let me clarify

We want to use Ms Access reports and the Create Report Wizard to allow our
end users to do ad hoc reporting.

Since the Create Report Wizard really expects the base query to be already
created so that any joins or selection is already performed in the query, we
would like to allow the execute code from the button to create the query, (we
have that part figured out) then launch the provided Ms Access Create Report
Wizard.

If possible we would like to provide the base query name and the Report Name
to the wizard without the user typing these in, then allow user to go throgh
the rest of the wizard to create the complete report. But we can't find the
object name or method or whatever to get the standard Create Report Wizard to
come up.

Thanks anyway.

Hey Jim? It sounds like you might be wanting to creat your own Report Wizard.
Take a look at the Help file regarding the CreateReport method. Here's an
excerpt from the opening paragraph:

"The CreateReport method creates a report and returns a Report object. For
example, suppose you are building a custom wizard to create a sales report. You
can use the CreateReport method in your wizard to create a new report based on a
specified report template."

You could create a blank template with your query as the recordset. Then you
could pop up a form to allow the user to choose the fields, etc.

Anyway, the actual wizard is exposed by adding a reference to ACWZMAIN.MDE.
I've never invoked a wizard through code though so I'm afraid that's all the
help I can be.

Sorry,
RD
 
Back
Top