ACC: IPF Referencing ControlSource Containing Code

ID: Q171179


The information in this article applies to:


SYMPTOMS

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

When you switch a form from Form view to Design view, you receive an invalid page fault.


CAUSE

This behavior occurs when the ControlSource property of a control on the form contains a function that tries to change the value of that control.


STATUS

Microsoft has confirmed this to be a problem in Microsoft Access 7.0 and 97.


MORE INFORMATION

Steps to Reproduce Problem

WARNING: Following these steps will cause an invalid page fault on your computer. Make sure you save and close any open work on your computer before following these steps.
  1. Open a new blank database in Microsoft Access 7.0 or 97.


  2. Create a new module and type the following procedure:
    
          Function MyFunction()
    
             Forms(0).Controls(0).ControlSource = ""
    
          End Function 


  3. Create a new form in Design View.


  4. Add a text box to the form and type the following in the ControlSource property of the text box:

    =MyFunction()


  5. On the View menu, click Form View (or Form in Microsoft Access 7.0).


  6. On the View menu, click Design View (or Form Design in Microsoft Access 7.0).

    Note that Microsoft Access returns an Invalid Page Fault.


Additional query words: access violation


Keywords          : kberrmsg FmsProb 
Version           : 7.0 97
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: April 26, 1999