Results 1 to 4 of 4

Thread: MS ACCESS - How can I get a Macro to Auto Run When Database Open + Closes ???

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Location
    Essex
    Posts
    14

    Question MS ACCESS - How can I get a Macro to Auto Run When Database Open + Closes ???

    Hello,

    Can anyone help ?

    I need to Automatically Run a macro when the database opens and Closes ???

    Any Ideas ??
    Steve

  2. #2
    Addicted Member
    Join Date
    Jan 2002
    Location
    Glasgow, Scotland
    Posts
    202

    Re: MS ACCESS - How can I get a Macro to Auto Run When Database Open + Closes ???

    If you name a macro:

    'AutoExec'

    it will run each time the database starts.

    on close, if you have an exit button:

    Code:
    docmd.RunMacro "AutoExec"
    if you fail to plan, you plan to fail

  3. #3
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: MS ACCESS - How can I get a Macro to Auto Run When Database Open + Closes ???

    Ewww macros

    VBA coding however ...

    Have a splash screen (form) and a background form.
    Tools>Start up options to get the splash screen form to open, in the OnLoad event run other code and open the background form (which is tiny and made invisible).
    The closing code then goes in the close or unload event of the background form which then is run as the db is shut.


    Its another option...

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  4. #4
    Addicted Member
    Join Date
    Jan 2002
    Location
    Glasgow, Scotland
    Posts
    202

    Re: MS ACCESS - How can I get a Macro to Auto Run When Database Open + Closes ???

    Quote Originally Posted by Ecniv
    Have a splash screen (form) and a background form.
    Tools>Start up options to get the splash screen form to open, in the OnLoad event run other code and open the background form (which is tiny and made invisible).
    The closing code then goes in the close or unload event of the background form which then is run as the db is shut.
    background forms can also be used for other tasks so it would be a good idea to implement.

    I use one which contains a timer loop and a flag check to allow me to log all of the users out of the database for maintenence.
    if you fail to plan, you plan to fail

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width