Results 1 to 8 of 8
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    AutoExec Macro (A2k)

    I have an AutoExec Macro:

    Minimise
    OpenForm................frm????????

    This works fine on opening the DB.
    When I use NoData event in a report, the DB window is maximised when the report closes.
    Is the Macro event supposed to be curent throughout the Database ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: AutoExec Macro (A2k)

    The AutoExec macro is only executed once, when you open the database. Morover, I don't see how a macro that contains a Minimize action would maximize the database window.

    Does your report contain DoCmd.Maximize in its On Open or On Activate event?

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoExec Macro (A2k)

    "Does your report contain DoCmd.Maximize in its On Open or On Activate event?"

    In this case no !!

    I had assumed as you stated, the macro only runs once. But I thought as there is no other command within the database which I see, could maximise the DB window or even show it.

    My thoughts are for future runtime models, or I would probably be better selecting "Hide Database Window" from startup options.

    Obviously the minimise from the macro is purely cosmetic.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: AutoExec Macro (A2k)

    I never use an AutoExec macro myself, I always use the Startup options instead.

    But I still don't see how a macro that minimizes an object could maximize anything, so the behavior you see must have another explanation.

  5. #5
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoExec Macro (A2k)

    Hans
    This is a new DB I am just messing with, 2 forms, 1 table etc.

    On one of the forms, I have DoCmd.Maximise on it's open event.
    When the form is closed, the DB window is visible Maximised.

    Ofter taking out the maximise line, the DB window acts as it should, still minimised.

    As I said, it's only a test database so not really a problem.
    Strange though the Maximise statement from the form effects in this way.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: AutoExec Macro (A2k)

    If you minimize one window within Access, all other windows are maximized too (except for popup windows). So when you maximize the form on opening it, the database window is maximized too, although you won't notice that immediately because the database windows is behind the form. If you don't like that, you should put DoCmd.Restore in the On Close or On Deactivate event of the form.

    And as you mentioned, if you hide the database window in startup options, this problem won't occur.

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: AutoExec Macro (A2k)

    commands like Maximize affect all the other windows except the dialogs. That includes the db window, and that is normal behavior in Access where all the windows are children of the parent application. I don't like maximized forms, so I don't run into this problem. I use maximize only for reports being previewed and always stick a DoCmd.Restore in the close event of the report.
    Charlotte

  8. #8
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoExec Macro (A2k)

    Just goes to show, you learn something new everyday.
    I shall watch for this in my main application.

    Never heard of the Restore method !! I'll do a couple of tests.

    Thanks Hans and Charlotte.
    Both have a good day.

Posting Permissions

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