Changing the Form Name in VBA Access

antonio.manoj.derose

Registered User.
Local time
Today, 18:57
Joined
Jul 4, 2013
Messages
62
Hi folks,

Good evening everyone, thank you for reading my post, I would like to ask how am I suppose to change the form name in the forms in
VBA access, now see I would not want to change the names by using the coding.

Please note that I have got so many forms, however I have worked with the default names to start some of them would be, form1, form2
Now, when I am trying to follow the best practice approch, by changing the form name by right clicking and hitting rename, I am unable
do so as it is popping up and giving me a statement as below.

"The form name 'Form2' is missspelled or refers to a form that does not exist" and continued in the next line as below
"if the invalid form name is in macro, an Action failed dialog box will display the macro name and the macro's arguments after you
click OK. Open the Macro window, and either the correct name."

Thanks,

Antonio
 
These error messages are most likely due to changing a form's name after you've created other dependent events/actions.
I'd suggest opening the VBA editor (Alt/F11) and use the search & replace facility to correct all instances of a change of object name. You'll need to check all of your code, all modules and all object related code. From your wording above, you probably need to check any macros too, also any queries that have criteria tied to a form.
This scenario shows the importance of choosing meaningful names for objects and the ensuing nightmare if they are changed.

David
 

Users who are viewing this thread

Back
Top Bottom