Using reports in an Add-in

D

Dan G.

ACC 2003

I would like my add-in to display a report that is saved in the
add-in. It doesn't seem to work. Forms work just fine: Call the
add-in from the menu, and the form opens. But that doesn't work for
reports. Anybody know a work around or fix for this? I know I could
just import the form to the database each time, but then I would have
to delete it each time too.

Thanks,

Dan
 
6

'69 Camaro

Hi, Dan.
Forms work just fine: Call the
add-in from the menu, and the form opens. But that doesn't work for
reports.

The Add-in's form opens when you call the Add-in from the menu because the
Add-in's entry point uses the DoCmd.OpenForm method to open that form. You
can create another entry point in this Add-in that will open the Add-in's
report for you. Find the standard module where the Add-in's entry point is
defined to view an example that works for the form, and you'll see how
simple it can be. Create a new public function in this module (or any other
standard module, for that matter) and use the DoCmd.OpenReport method to
open your report in this new function.

Now, when the Add-in is open, you can call this public function from your
Add-in (perhaps with the OnClick event of a button on your Add-in's form).
You can also use this Add-in as a library database and call the public
function from code to open the Add-in's report whenever you need it. Even
if you don't want to use the Add-in as a library database but want to view
the Add-in's report, you can open the Add-in database in code and then call
the public function that opens your report.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
Top