Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
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
Upload Images   Link   Email  
Can't Delete Empty Subs in VBA
Steve Garrison 
     
3 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 
          
3 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 OP 
     
3 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 
          
3 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.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 1/24/2025 2:46:05 PM. PLT: 0s