PRB: Insert Event Executed by Unbound Controls

    Article ID: Q109732
    Creation Date: 06-JAN-1994
    Revision Date: 19-SEP-1996

    The information in this article applies to:

    • Microsoft Access versions 1.0 and 1.1

    SYMPTOMS

    A form's Insert event runs when you select an unbound control on the form.

    CAUSE

    The Insert event is triggered when a form's dynaset is modified by any changes to the dynaset. Note that the form must be positioned on a new record for this behavior to occur.

    RESOLUTION

    Use other form or control properties to execute the macros you want. Be aware that the OnInsert property does not check to see whether controls are bound to the form's record source.

    STATUS

    This problem no longer occurs in Microsoft Access version 2.0.

    MORE INFORMATION

    Steps to Reproduce Behavior

    1. Open the sample database NWIND.MDB.
    2. Create the following macro and save it as Macro1:

            Macro Name  Actions
            ------------------------------
            Macro1      MsgBox
      

            MsgBox Actions
            ------------------------------
            MsgBox
               Message: OnInsert triggered
               Beep: Yes
               Type: None
      
    3. Open the Customers form in Design view.
    4. Add an unbound check box to the form and set the form's OnInsert property to Macro1. Save the form as Cust1.
    5. View the Cust1 form in Form view and then choose Data Entry from the Records menu.
    6. Select the unbound check box. Note that the message box appears indicating that the form's OnInsert event occurred.

    REFERENCES

    Microsoft Access "Language Reference," version 1.0, "OnInsert, OnDelete Properties," pages 338-339


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.

Additional reference words: 1.00 1.10 oninsert form properties
KBCategory: kbusage
KBSubcategory: FmsEvnt