1. Computing & Technology

Discuss in my forum

In a recent forum message, mbocho wrote:

"I created a new form in design view. Access gave it the name 'Form1'. Then I added a control in the form (a combo box), gave it a name; then went to properties and attached an event procedure to the "After Update". Shortly after that, I went back to access and named the form frmGraph. Then added another control. When I went back to VBA, gave me an error message saying form1 does not exist. Form1 is visible only in VBA, but not in Access objects window.

How can I remove this rogue form?! I cannot move! The error message is as shown in the attached picture."

Do you have any advice for mbocho? Are you experiencing the same problem? Visit the About Databases forum and join the discussion!
Comments
May 19, 2010 at 2:06 am
(1) Anne Klopper :

Go to the code window and do a find and replace “Form1″ with the changed form name. VBA is looking for Form1 which no longer exists. This should resolve this issue.

Good Luck

June 4, 2010 at 9:11 am
(2) Guy Labreche :

Bonjour!

Most likely, when you first built your form Form1, you must have written VBA code that referred to objects or controls on your form, for example statements like Forms![Form1]![cmbCountryCode].BackColor=65535. Renaming the form does not automatically changes form name references in the form’s VBA code.

To fix this problem, go into Design View of your renamed form and take a close look at the code you have written (or that the Form Wizard has generated for you) in each of the Event Procedures attached to your form (on the View menu, select Code).

Some statements still most probably refer to the old form name. i.e. Form1.

A simple Replace (Edit menu, Select Replace) of all occurences of the string ‘Form1′ by ‘frmGraph’ and the error message should no longer be.

Have a great day!

Guy

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>
Related Searches microsoft access microsoft

©2012 About.com. All rights reserved.

A part of The New York Times Company.