Reports_AddIn Version 1.0
Copyright (C) A.D. Tejpal 2008
Thanks for trying Reports_AddIn for MS Access
This utility shows names of all reports in host db in a list box and opens the selected one.
Requirements
Microsoft Access 2000 or later
Microsoft Windows 98 or later
Installation
The folder Reports_AddIn should be put directly on the C: drive, so that the
path for .mda file is -
C:\Reports_AddIn\Reports_AddIn.mda. (This is
important, so as to establish the correct registry key)
Open any database in Access and click on Tools > Add-Ins > Add-In
Manager.
Click on Add New. Browse to the folder and file at C:\Reports_AddIn\Reports_AddIn.mda
Click OK. This will copy the .mda file to Microsoft's default Add-in folder for
Access.
You have to do this only once.
Use
To use Reports_AddIn from within any database, click Tools > Add-Ins >
Reports_AddIn
========================================================
Technical Notes:
Sample AddIn named Reports_AddIn.zip,
when invoked in the host db, displays the names of all reports in host db
on a list box on a form belonging to AddIn. Selected report can be opened by
clicking a command button on this form.. Certain factors required to be
kept in view are mentioned below:
1 - For code contained in modules
belonging to the AddIn:
(a) If the
AddIn is opened independently, CurrentProject / CurrentDb are identical
to CodeProject / CodeDb respectively (all refer to AddIn itself).
(b) If the AddIn
is activated in host db, CurrentProject / CurrentDb refer to host db
while CodeProject / CodeDb refer to AddIn itself.
(c) Host
applications AllForms / AllReports collections can be accessed by code in
AddIn, using CurrentProject.
(d) Tables / Queries
are not covered by collections like those in prev para.
(e) While the AddIn
is in activated state, any query / table / form / report, whether in host
db or in the AddIn, can be opened directly by name, using DoCmd
statement in AddIn code, without having to use any special qualifier.
(f) If any pair of similar
objects exists both in the AddIn as well as the host db, code in AddIn
module will act upon the object located in the AddIn itself.
(g) For code in
AddIn module, when the AddIn is in activated mode, queries / recordests based
upon CurrentDb do not recognize the tables in AddIn itself, unless referred
via IN clause, giving full path of the AddIN. This path, returned by
CodeProject.FullName, refers to the original location of AddIn mda file e.g.
C:\REPORTS_ADDIN\REPORTS_ADDIN.MDA and not the shadow AddIn file in AddIns
folder in MyDocuments. There is no such problem if queries / recordsets
are based upon CodeDb instead of CurrentDb.
2 - For code contained in modules
belonging to the host db:
(a) CurrentProject
/ CurrentDb are identical to CodeProject / CodeDb respectively, always
referring to the host db, irrespective of the fact whether the AddIn is in
activated state or not.
(b) Whereas code in
the AddIn can access all tables / queries / forms / reports, whether belonging
to AddIn or the host db (see para 1 (e) above), code in host db can
directly access only the objects belonging to host db itself.
=============================================================