J
Jerry Crosby
If discovered that if I create a command button and edit what it does and
THEN change the name, I end up with a section of code for the old name that
no longer exists. Is there an easy way to search through your code and
delete all subs that refer to non-existant names?
Example: I create a command button using the wizard. It's automatically
given a name like "Command22" and creates a sub routine named
Command22_OnClick in the code. Later, if I change its name to "Print" it
will create a NEW blank sub routine named Print_OnClick and the subroutine
for Command22 remains, just taking up space.
The same thing happens if I create a command button and later delete it.
The underlying code remains.
Should I be doing something differently to keep my code from getting
cluttered? I know if I rename the button immediately before touching any of
the event code, I'm good. But I can't always think ahead like that!
Thanks in advance.
Jerry
THEN change the name, I end up with a section of code for the old name that
no longer exists. Is there an easy way to search through your code and
delete all subs that refer to non-existant names?
Example: I create a command button using the wizard. It's automatically
given a name like "Command22" and creates a sub routine named
Command22_OnClick in the code. Later, if I change its name to "Print" it
will create a NEW blank sub routine named Print_OnClick and the subroutine
for Command22 remains, just taking up space.
The same thing happens if I create a command button and later delete it.
The underlying code remains.
Should I be doing something differently to keep my code from getting
cluttered? I know if I rename the button immediately before touching any of
the event code, I'm good. But I can't always think ahead like that!
Thanks in advance.
Jerry