PC Review


Reply
Thread Tools Rate Thread

Auto Executing module

 
 
Peter Marshall
Guest
Posts: n/a
 
      16th Jun 2004
How do I get a vba module to execute as soon as my Access 2002 application
is loaded (even before the Switchboard loads)?


 
Reply With Quote
 
 
 
 
Wayne Morgan
Guest
Posts: n/a
 
      16th Jun 2004
I just tested and the startup form's Open event fires before the Autoexec
macro, if you have one. So, the form appears to be the first thing to run.
If you want it to run before the switchboard, you may be able to open
another form, place code in it, and open the switchboard from that form.
However, if you are trying to run something that will allow you to cancel
the opening of the switchboard, you may be able to do it in the
switchboard's Open event and use the Cancel ability built-in there. I tried
setting Cancel = True in my startup form's Open event, the form never showed
on the screen and I received no errors.

--
Wayne Morgan
MS Access MVP


"Peter Marshall" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How do I get a vba module to execute as soon as my Access 2002 application
> is loaded (even before the Switchboard loads)?
>
>



 
Reply With Quote
 
Peter Marshall
Guest
Posts: n/a
 
      16th Jun 2004
Thanks, Wayne. Calling my module from the Open event of my main switchboard
works fine. I was just concerned that the module would execute everytime
the main menu appears, but it is really only opened when the app loads (it
is minimized during other times).


"Wayne Morgan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I just tested and the startup form's Open event fires before the Autoexec
> macro, if you have one. So, the form appears to be the first thing to run.
> If you want it to run before the switchboard, you may be able to open
> another form, place code in it, and open the switchboard from that form.
> However, if you are trying to run something that will allow you to cancel
> the opening of the switchboard, you may be able to do it in the
> switchboard's Open event and use the Cancel ability built-in there. I

tried
> setting Cancel = True in my startup form's Open event, the form never

showed
> on the screen and I received no errors.
>
> --
> Wayne Morgan
> MS Access MVP
>
>
> "Peter Marshall" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > How do I get a vba module to execute as soon as my Access 2002

application
> > is loaded (even before the Switchboard loads)?
> >
> >

>
>



 
Reply With Quote
 
Alex Dybenko
Guest
Posts: n/a
 
      16th Jun 2004
then try to use autoexec macro, first run your code there, then open
switchboard

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com


"Peter Marshall" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Thanks, Wayne. Calling my module from the Open event of my main

switchboard
> works fine. I was just concerned that the module would execute everytime
> the main menu appears, but it is really only opened when the app loads (it
> is minimized during other times).
>
>
> "Wayne Morgan" <(E-Mail Removed)> wrote in

message
> news:(E-Mail Removed)...
> > I just tested and the startup form's Open event fires before the

Autoexec
> > macro, if you have one. So, the form appears to be the first thing to

run.
> > If you want it to run before the switchboard, you may be able to open
> > another form, place code in it, and open the switchboard from that form.
> > However, if you are trying to run something that will allow you to

cancel
> > the opening of the switchboard, you may be able to do it in the
> > switchboard's Open event and use the Cancel ability built-in there. I

> tried
> > setting Cancel = True in my startup form's Open event, the form never

> showed
> > on the screen and I received no errors.
> >
> > --
> > Wayne Morgan
> > MS Access MVP
> >
> >
> > "Peter Marshall" <(E-Mail Removed)> wrote in

message
> > news:(E-Mail Removed)...
> > > How do I get a vba module to execute as soon as my Access 2002

> application
> > > is loaded (even before the Switchboard loads)?
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Peter Marshall at OCC
Guest
Posts: n/a
 
      16th Jun 2004
Alex, I like your solution too. I had tried to write a macro to execute a
function but the function wasn't listed. Then I found that I had originally
declared it as Private not Public. Also I wasn't sure what the name of the
macro had to be. All is well now. Thanks guys for your expert help!


"Alex Dybenko" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> then try to use autoexec macro, first run your code there, then open
> switchboard
>
> --
> Alex Dybenko (MVP)
> http://Alex.Dybenko.com
> http://www.PointLtd.com
>
>
> "Peter Marshall" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > Thanks, Wayne. Calling my module from the Open event of my main

> switchboard
> > works fine. I was just concerned that the module would execute

everytime
> > the main menu appears, but it is really only opened when the app loads

(it
> > is minimized during other times).
> >
> >
> > "Wayne Morgan" <(E-Mail Removed)> wrote in

> message
> > news:(E-Mail Removed)...
> > > I just tested and the startup form's Open event fires before the

> Autoexec
> > > macro, if you have one. So, the form appears to be the first thing to

> run.
> > > If you want it to run before the switchboard, you may be able to open
> > > another form, place code in it, and open the switchboard from that

form.
> > > However, if you are trying to run something that will allow you to

> cancel
> > > the opening of the switchboard, you may be able to do it in the
> > > switchboard's Open event and use the Cancel ability built-in there. I

> > tried
> > > setting Cancel = True in my startup form's Open event, the form never

> > showed
> > > on the screen and I received no errors.
> > >
> > > --
> > > Wayne Morgan
> > > MS Access MVP
> > >
> > >
> > > "Peter Marshall" <(E-Mail Removed)> wrote in

> message
> > > news:(E-Mail Removed)...
> > > > How do I get a vba module to execute as soon as my Access 2002

> > application
> > > > is loaded (even before the Switchboard loads)?
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
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
executing a module =?Utf-8?B?Z21hbmFzc2E=?= Microsoft Access 5 24th Oct 2007 07:56 PM
RE: executing module from form =?Utf-8?B?VG9ueQ==?= Microsoft Access VBA Modules 0 12th Jan 2007 04:32 AM
executing form.sub from a module excelleinc.com Microsoft VB .NET 4 29th Apr 2005 03:06 PM
Sub in Module not executing? =?Utf-8?B?UGF0IERvb2xz?= Microsoft Access Forms 0 7th Jan 2005 03:19 AM
Executing Module from Button Newman Microsoft Dot NET Framework Forms 1 18th Dec 2003 10:35 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:59 PM.