How to make a report?

  • Thread starter Thread starter daMike
  • Start date Start date
D

daMike

Hello,

I already made a form with several textboxes.
These textboxes contain the criteria for the
report/query. Can somebody please explain me
how to make a report with VBA? There should be
a botton on the form with the textboxes which
starts a routine to build the report automatically.
I have not really much experience with Access
so please keep it simple. I work with WinXP
and Access 2002.

Thanks in advance!
Michael
 
Mike

Not sure I fully understand. Reports in Access are usually based on a table
or a query. Selection criteria to be used in running a query can be "set"
on a form. But your description sounds like you might be putting data on a
form and creating a report from THAT data.

First, design a query that returns the data you wish to have on your report.
If necessary, build a form to hold selection criteria, and in your query,
"point" to the form's controls for the criteria. Next, build a report based
on the query.

Finally, on the form, add a command button that opens the report -- if
you're working in design mode on the form, turn on the toolbar wizard for
help adding the command button.

Good luck!

Jeff Boyce
<Access MVP>
 
I assume you already have the report designed, based on the query and just
want to be able to open it from a command button on a form.

Place a command button on a form, set up an event procedure for On Click,
and in the procedure insert the code:

DoCmd.OpenReport "rptName", acViewPreview

This will open the report in preview mode. If you leave out the
acViewPreview arg it will output the report to a printer.

Marty
 
Back
Top