Free Lessons
Fast Tips
Topic Index
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
Home > TechHelp > Directory > Access > Invoicing > < Switch Function | Templates >
Back to Invoicing    Comments List
Can't Delete Empty Subs in VBA Upload Images   Link   Email  
Steve Garrison        
2 years 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            
2 years 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        
2 years 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            
2 years 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 in Invoicing.


The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.

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
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/21/2024 6:38:23 AM. PLT: 0s