old data still showing in VB

  • Thread starter Thread starter JB
  • Start date Start date
J

JB

Hello.
Happy Easter.
I've noticed that when I delete controls from a form it doesn't seem to
remove the entries in from VB.
Is there a way to do a clean up of unused code?

Jen
 
JB said:
Hello.
Happy Easter.
I've noticed that when I delete controls from a form it doesn't seem to
remove the entries in from VB.
Is there a way to do a clean up of unused code?

Jen

Here's one little trick that may help. If you once had a command button on
the form, called btnGo, the quick way to find any orphaned event procedures
is to go into the VBE and drop down the right hand combo at the top of the
window. Should you spot an entry 'btnGo_Click', that's an orphaned procedure
which may be deleted.
(if the button was still there, the left hand combo would contain an entry
'btnGo' and the right hand one would have 'Click' in bold).
 
Here's one little trick that may help. If you once had a command button on
the form, called btnGo, the quick way to find any orphaned event procedures
is to go into the VBE and drop down the right hand combo at the top of the
window. Should you spot an entry 'btnGo_Click', that's an orphaned procedure
which may be deleted.
(if the button was still there, the left hand combo would contain an entry
'btnGo' and the right hand one would have 'Click' in bold).

In addition, in my experience the orphan code is shuffled up to the very top
of the VBA editor window. Can't guarantee this but it's a quick check.
 
John W. Vinson said:
In addition, in my experience the orphan code is shuffled up to the very
top
of the VBA editor window. Can't guarantee this but it's a quick check.

You saying it changes position in the module? I've never noticed that.

Another option might be my March, 2004 "Access Answers" column in Pinnacle
Publication's "Smart Access", where I show how to identify code that's not
linked to a control. You can download the column (and sample database) for
free at http://www.accessmvp.com/DJSteele/SmartAccess.html
 
Ok will give all suggestions a go
Thank you

Douglas J. Steele said:
You saying it changes position in the module? I've never noticed that.

Another option might be my March, 2004 "Access Answers" column in Pinnacle
Publication's "Smart Access", where I show how to identify code that's not
linked to a control. You can download the column (and sample database) for
free at http://www.accessmvp.com/DJSteele/SmartAccess.html
 
Back
Top