autoexec macro to validate opening of the project's main form

  • Thread starter Thread starter Mark Kubicki
  • Start date Start date
M

Mark Kubicki

I've been told I need to write an autoexec macro to deal with my
challenge...

The main form [frmMainMenu] in a Project requires information from a linked
MDB for it to load and open correctly.

It is possible that the linked MDB may not be present (it may have been
renamed , moved, etc...); and trying to open without it, results in an
error...

I would use the AE/Macro to check for this... if there is a problem, then I
would open a different form [frmLinkFile] that prompts the user for the
name, path, etc... of the (missing) linked file (and then re-link the tables
....)

O.K., so, I've taught myself (at a newbie level) enough VBA to get this
far... and I already have a form in the project that allows the user to
choose and relink a MDB... but I've NEVER EVER previously opened the
MacroEditor... I'm at a total loss. Could some one direct me to where I
should start, or to an example, form, web page, or "something"

BIG thanks in advance,
Mark
 
I wouldn't be doing the relinking in a macro -that would be code behind the
alternate startup form (frmLinkfile);

I simply need the macro to help determine if the frmMainmenu will fail on
its load; if it does than an alternate startup form [frmLinkFile] will be
used

mark

---------------------------------------------------------.

Steve Schapel said:
Mark,

As far as I know, this can not be done in a macro. You will need a VBA
procedure.

Have a look at http://www.mvps.org/access/tables/tbl0009.htm for some
sample code.

--
Steve Schapel, Microsoft Access MVP


Mark Kubicki said:
I've been told I need to write an autoexec macro to deal with my
challenge...

The main form [frmMainMenu] in a Project requires information from a
linked MDB for it to load and open correctly.

It is possible that the linked MDB may not be present (it may have been
renamed , moved, etc...); and trying to open without it, results in an
error...

I would use the AE/Macro to check for this... if there is a problem,
then I would open a different form [frmLinkFile] that prompts the user
for the name, path, etc... of the (missing) linked file (and then re-link
the tables ...)

O.K., so, I've taught myself (at a newbie level) enough VBA to get this
far... and I already have a form in the project that allows the user to
choose and relink a MDB... but I've NEVER EVER previously opened the
MacroEditor... I'm at a total loss. Could some one direct me to where I
should start, or to an example, form, web page, or "something"

BIG thanks in advance,
Mark
 
Back
Top