Code actually being used?

  • Thread starter Thread starter Albert D. Kallal
  • Start date Start date
A

Albert D. Kallal

There is no automatic easy solution to this problem that I know of. about
the only suggestion I can say is get in the habit of deleting the code
first, and then the control.

On the other hand I been meaning for several years now to write some code
that would actually go through a form's module code and look for orphaned
event code that's not attached to any of the available controls.
 
All the orphaned code will be in the General section of your code window,
and it will all likely have a control name. So if you see:

Private Sub Whatever_AfterUpdate()

and the combo in the upper left side of the code window says General, just
change the name to something like:

Private Sub Whatever_DeleteMe_AfterUpdate()

then go through your app and see if anything breaks. If nothing does, it's
probably safe to do a search for:

DeleteMe

and delete the code in that routine. I'd make a backup before I started
deleting things though, just in case you're to quick on the trigger.
 
Going through my codes if I come across and Commands and Combos with numbers
after them, is it possible if they have a control, I know I can see there on
a Form but may be that control was deleted..............Bob
 
Thanks Albert, I have gone through all my forms and Reports and made sure
all my codes are lbl, tb ,cmb, cnd lst so any thing that is TextBox,
Command**,Label I can Delete?.................Thanks Bob
 
Thanks Arvin good idea..........Bob

Arvin Meyer said:
All the orphaned code will be in the General section of your code window,
and it will all likely have a control name. So if you see:

Private Sub Whatever_AfterUpdate()

and the combo in the upper left side of the code window says General, just
change the name to something like:

Private Sub Whatever_DeleteMe_AfterUpdate()

then go through your app and see if anything breaks. If nothing does, it's
probably safe to do a search for:

DeleteMe

and delete the code in that routine. I'd make a backup before I started
deleting things though, just in case you're to quick on the trigger.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 

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

Back
Top