VBA Controll Names and Form Controll Names are not syncronising. B

G

Guest

I added a number of controls to an Access 2003 form. I then painstakingly
named each control using standard naming conventions. IE change Command2 to
cmdGetRecords. When I move from the form designer in Access to the VBA
coding environment, the names sometimes have the old names and sometimes have
the new ones, yet the form designer still has the correct control names.
Additionally the VBA environment is registering controls that I have deleted.
I have tried closing and opening the database and compacting and repairing
but to no avail. Is this a bug? Is there a work around?
 
D

Douglas J Steele

Changing the name of the control does not change references to the control
in VBA code unless you have AutoCorrect on (and having it on introduces far
more issues than it solves).

Deleting a control does not delete code associated with the control.
 
G

Guest

I always name my controls first before writing any code, but if, like me, you
have inherited somebody else's sloppy work, this is a pain and there is no
quick fix.

However I can recommend FMS Total Access Analyzer as this will find any
'orphaned' code. You can also do 'Find and Replace' in your code. Acess
Analyzer will also examine queries, etc for references to form controls
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top