I renamed a subform. VBA and SQL have trouble with new name.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using Access 2002. I renamed a subform. For some tasks VBA recognizes
the old name and for some tasks the new name. I can generally discover
through trial and error which name to use. I can't get a query to recognize a
control on the subform using either name.
 
Presumably you mean that on the Forms tab of the database window, you
changed the name of the form that is the subform?

Firstly, lets unconfuse Access by disabling the dreadful "Name AutoCorrect"
options under:
Tools | Options | General | Name AutoCorrect
For an explanation of why, see:
http://allenbrowne.com/bug-03.html
Then compact the database to get completely rid of this stuff:
Tools | Database Utilities | Compact

Now, open the main form in design view.
Right-click the edge of the subform control, and choose Properties.
On the Data tab, make sure the Source Object matches the new name you gave
the form.

On the Other tab of the properties box, you will see that the Name of the
subform control is still the old name, and this is probably the source of
the confusion, and why the old name is still sometimes required/used. You
might want to change this name to match the new name of the form. You can
then do a search'n'replace in your code and completely replace the old name
with the new one.
 
Back
Top