Well, seeings how this would only happen with the control's event proceedures (any other code would cause an error if Option Explicit is on, or unless you have a variable with the same name as the removed control) then I guess the best method is experience and habit.
Before removing the control, look in the controls code events window to see if there are any (Bold text), and if so, click on them and remove them.
I believe I have Option Explicit on and no vars with the same name. I am at currently removing the code simliar to your suggestion.
1. A control is removed from a form that has event code in it.
2. In the Form's General area code remnants from the removed control are visible.
3. I manually remove the private sub that has no control parent.
I was hoping there would be an automated way to do this. I think VB3 does it for you.
which has a 'Review source code' tool amongst a load of other useful gadgets
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'People who live in windowed environments shouldn't cast pointers.'
Thanks John for putting the mztools package on the site, I downloaded it and used the review source code. Very good, I had to assure myself it was telling me the truth before I deleted numerous lines of unwanted/unused event code, and it was totally correct. Deserve a star for a useful freebie. Thanks
Thanks for the suggestion John. It looks to go to be true, maybe we could get some people to test this out, I'm still leary on using it. I do not want to have any of my code to 'disappear'. Rob
I've been using it for some time, and have seen no problems yet!
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'People who live in windowed environments shouldn't cast pointers.'
I too use mztools and have not experience any problems. Good Luck
-------------- As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.