PRB: Activate, Deactivate Events Do Not Occur on Pop-Up Form

    Article ID: Q117173
    Creation Date: 22-JUN-1994
    Revision Date: 01-DEC-1996

    The information in this article applies to:

    • Microsoft Access versions 2.0, 7.0, 97

    SYMPTOMS

    Moderate: Requires basic macro, coding, and interoperability skills.

    The macro or code specified by a pop-up form's OnActivate or OnDeactivate property setting is not triggered as you expect.

    CAUSE

    The Activate and Deactivate events are triggered only when you switch among forms that are "child" forms of the Microsoft Access MDI window. Child forms are forms that have a Windows window style of WS_CHILD, and whose parent is the MDI window. Pop-up forms have a window style of WS_POPUP, and are not governed by the same Windows MDI messages and events as child windows.

    RESOLUTION

    Instead of assigning your macro or code to the pop-up form's Activate or Deactivate event, try using the Open, Load, Resize, or Current event instead.

    MORE INFORMATION

    Steps to Reproduce Behavior

    1. Create a new form not based on any table or query and name it Test Pop-Up.
    2. Set the form's OnActivate property to the following macro. Use the Macro Builder to create the macro. Save the macro as Beep.

            Action
            ------
            Beep
      
    3. Set the OnDeactivate property to the Beep macro.
    4. Close the form, and then open it in Form view. Note that you hear the beep when you open the form.
    5. Select the Database window, and then select the form. Note that you hear the beep when you toggle back and forth between the form and the Database window.
    6. View the form in Design view. Set its PopUp property to Yes. Save the form, and then close it.
    7. Open the form in Form view. Select the Database window, and then select the form. Note that you do not hear the beep as you toggle back and forth between the form and the Database window.

    REFERENCES

    For more information about Activate, Deactivate, Open, Load, Resize, or Current event, search the Help Index for the event, or ask the Microsoft Access 97 Office Assistant.


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
©1997 Microsoft Corporation. All rights reserved. Legal Notices.

KBCategory: kbusage
KBSubcategory: FmsEvnt
Additional reference words: 2.00 7.00 97 8.00