Access.2007.VBA.Bibl..

(John Hannent) #1
Figure 16.34 shows the new form; the new report is similar.

FIGURE 16.34

A form created by the add-in.


The form is called Form1 (or another number); it can’t be renamed in code, either in the
Visual Studio add-in or directly in Access VBA, because the Nameproperty of the Form
object is read-only when the form is created using the CreateFormmethod (and similarly for the
CreateReportmethod).

Summary ..........................................................................................................................


After working with all three add-in types (Access, VB 6, and Visual Studio 2005), my conclusion is
that Access add-ins have advantages over both VB 6 and Visual Studio 2005 add-ins, at least if you
are running Windows XP. One of the most significant advantages of Access add-ins is that they are
themselves Access databases, and this allows you to copy database objects from the code database
to the calling database. If you need forms in a VB or Visual Studio add-in, you have to create them
from scratch as VB or Windows forms; reports (in some versions of VB), can only be created using
Crystal Reports. Another advantage of Access add-ins is that only an Access add-in can create a
wizard or builder. And finally, Access add-ins use VBA code, so you don’t need to learn a new pro-
gramming dialect, just a few special techniques.

However, if you want your Access add-ins to create custom Ribbons, there are some roadblocks at
present. Getting the custom Ribbon to display, and to run add-in code, may require so much time
spent in uninstalling and reinstalling the add-in, unloading and reloading the table, and closing

NOTENOTE


Customizing the Access Ribbon with a Visual Studio 2005 Shared Add-in 16

Free download pdf