News, links, downloads, tips and tricks on Microsoft Access and related

About Me Search
Name:Alex Dybenko

Location:Moscow, Russia

Monday, November 12, 2007

How to run add-in from code

If you have some add-in installed with Access – you can run it using Menu Tools-Add-Ins. But sometimes you need to run it from button click on your form. Here a VBA code which starts add-in Translator:

Dim cb As CommandBar, cbb As CommandBarControl
Set cb = CommandBars("Menu Bar")
Set cbb = cb.Controls("&Tools").Controls("Add-&Ins").Controls("Translator")

Friday, November 02, 2007

One event procedure for several controls

I have got a question – how to make a common event procedure for several controls? This is not a problem for Click event, you just make a public function and set OnClick property to it as =MyFunction(). But this does not work for event procedure like Mouse Move, where you need to pass arguments there. John Mishefske, Access MVP, provided a solution where he made a class with class-level variable declared WithEvents, so event is execute in this class. The code in sample database explains for itself.

Using Database Library Files in Your Access Application

A great article by Andrew Wrigley discussing how you can build a library database with reusable forms, reports and VBA code to be shared within several applications.