[AccessD] How would you declare a variable pointing to an attached project?

philippe pons phpons at gmail.com
Fri Aug 31 10:55:45 CDT 2007


Hi,

In my main Access application, I referenced another mdb file of
which I need to run a form from the main.

I managed to have the following snippet running ok!

Public Function ppSendEmail()
    ' init de la gestion d'erreur: la bibliothèque peut ne pas avoir
été référencée
    On Error GoTo ppSendEmail_Error

    AccXP_Mail.modDivers.openFrmCourriel

    ' AccXP_Mail: the name of the project of the AccXP_Mail.mdb
attached
    ' modDivers: the name of the code module
    ' openFrmCourriel: the public function that open the form
    On Error GoTo 0
    Exit Function

ppSendEmail_Error:

        MsgBox ("La fonction d'envoi d'email n'est pas installée!")
End Function

The problem is that in case the AccXP_Mail.mdb is not attached, a
compilation error is triggered due to the fact that
AccXP_Mail has not been declared. And the error is not trapped by the
On Error GoTo ppSendEmail_Error.
I tried different things to try declare AccXP_Mail, but unsuccessfully
till now.
How would you do that?

TIA,

Philippe



More information about the AccessD mailing list