old data still showing in VB

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
 
S

Stuart McCall

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).
 
J

John W. Vinson

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.
 
D

Douglas J. Steele

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
 
J

JB

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
 

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