Microsoft KB Archive/295228

= ACC2002: Cannot Add Control While Code Is Running Behind Form =

Article ID: 295228

Article Last Modified on 11/5/2003

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q295228



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

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SYMPTOMS
When you try to add a control to a form, you receive the following error message:

Microsoft Access can't add, rename, or delete the control(s) you requested.



CAUSE
If code in the module of a form continues to run after the form has been closed, you may not be able to add new objects to the form.



RESOLUTION
Close and then reopen the database. Change the code so that it does not continue to run after the form is closed.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce the Behavior
 Open the sample database Northwind.mdb. Open the Customers form in Design view. Add a command button to the form. Cancel the Command Button Wizard if it starts.  Type or paste the following code in the Click event of the command button. Private Sub Command0_Click While True DoEvents Wend End Sub  Save and then close the form.</li> Open the Customers form in Form view, and then click the command button. Close the form.</li> Open the form again in Design view, and then try to add any control.</li></ol>

Note that you receive the error message that is mentioned in the &quot;Symptoms&quot; section of this article.

Additional query words: pra OfficeErrorMessages 10014

Keywords: kberrmsg kbbug kbpending KB295228

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.