Free Lessons
Fast Tips
Topic Index
Home   Courses   Seminars   Templates   TechHelp   Fast Tips   Forums   Help   Contact   Join   Order   Logon  
Home > TechHelp > Directory > Access > Invoicing > < Switch Function | Templates >
By Richard Rost   Richard Rost on Twitter Richard Rost on LinkedIn Email Richard Rost   17 months ago

Back to Invoicing

Can't Delete Empty Subs in VBA Upload Images   Link  
Steve Garrison 
55 days ago
I seem to have the following, and similar, subroutine statements in some of my VBA modules:

   Private Sub CustomerLF_Click()

   End Sub

Obviously the control name isn't the same in each case.  I think these got into the modules as I selected the 'On Click' event by mistake when I really wanted the 'On Dbl Click' event.  My problem is that I can't delete any of them.  They don't seem to be causing any issues, but I would like to clean up my fat finger mistakes.
Scott Axton
55 days ago
You have to actually delete the code from in the Code Window.

Just select the code - hit the delete key - and Save the module.
Steve Garrison
55 days ago
I have tried that, but it seems to be to no avail.  I've deleted the code in the Code Window, saved, exited, looked at the properties sheet for the control, and it appears that the 'Event Procedure' is gone from the 'On Click.'  But I can completely exit Access, reload my database and the 'On Click' 'Event Procedure' has magically reappeared.  Again it doesn't really seem to hurt anything, but I would really like to clean things up.

I may try putting a 'msgbox' in the subroutine, clicking to see if it responds with the message box, and then try deleting the code.

Thank you very much for your VERY quick replies!
Scott Axton
55 days ago
Try this:
Back up first.

In the property sheet of the form single click on the On Click event to highlight the procedure.  Press Delete key to get rid of it.  Save the form.
Then click on the ... by the On Dbl Click event to go to the Code window.
Select the whole sub (From Private down to End Sub) and delete that.  Save and close the Code window.
Save the form again and close it.

Go up to Database Tools on the menu and choose Compact and Repair Database.

Sometimes Access just gets "out of sync" and that should put you back in working order.

That should get you.  If it doesn't check out the Troubleshooter and follow the bouncing ball on that page.

This thread is now closed. If you wish to comment, start a NEW discussion, below.

Back to Invoicing Comments

Start a NEW Conversation
Only students may post right now. Click here for more information on how you can set up an account. If you are a student, please LOG ON first.

You may want to read these articles from the 599CD News:

6/30/2022Sales Chart
6/27/2022Rounding Errors
6/26/2022Calendar Seminar Students Only
6/24/2022Multi Combo One Field
6/23/2022Modal & Popup
6/21/2022Week of Year
6/16/2022Value List Combo
6/14/2022Project Budgets
6/14/2022Find Record

Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
My Account
My Courses
Lost Password
Student Databases
Change Email
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Customer Support
Web Site Tour
Consulting Services
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Video Tutorials
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Terms of Sale
Contact Info
Support Policy
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn