PC Review


Reply
Thread Tools Rate Thread

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

 
 
Mark Kubicki
Guest
Posts: n/a
 
      3rd Aug 2009
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


 
Reply With Quote
 
 
 
 
Steve Schapel
Guest
Posts: n/a
 
      3rd Aug 2009
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" <(E-Mail Removed)> wrote in message
news:#yQ#(E-Mail Removed)...
> 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
>

 
Reply With Quote
 
Mark Kubicki
Guest
Posts: n/a
 
      3rd Aug 2009
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:#yQ#(E-Mail Removed)...
>> 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
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validate table via form before update macro or vba headly Microsoft Access 3 5th Dec 2008 03:55 AM
Re: disable Excel AutoExec macro when opening via Access Automation Dale Fye Microsoft Access 3 15th May 2008 04:10 AM
Re: disable Excel AutoExec macro when opening via Access Automation Dale Fye Microsoft Access External Data 3 15th May 2008 04:10 AM
autoexec macro to run on opening the spreadsheet =?Utf-8?B?TGVl?= Microsoft Excel Misc 2 20th Jan 2007 02:01 PM
Autoexec form with choice of macro to run P Brainard via AccessMonster.com Microsoft Access Forms 1 21st Feb 2005 11:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:07 AM.