Results 1 to 3 of 3
  1. #1
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    305

    Need help cleaning up VBA


    I inherited a database and there's multiple forms whose VBA is a mess. Mainly, there are tons of instances where there's 'on click' code for a command, but there's no corresponding command in the form. I suspect someone just deleted these commands and never modified the VBA.

    Is there a way to quick identify code which doesn't have a corresponding command on the form?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    in vbe screen, if you click on the far right drop down box (declarations),
    and see btnXX_click , and other contol events there, yes, they deleted the control and the orphan events are in that box.

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    In my 2016 version, deleting an event (OK, at least a button click event) removes the event from the control in the property sheet as long as the change has been saved in design view. Seems to me that the events should be removed when the code is deleted? Perhaps if you compiled the code that might fix it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Help Cleaning Up My Code
    By CharissaBelle in forum Programming
    Replies: 3
    Last Post: 05-01-2017, 12:38 PM
  2. Help data cleaning
    By baronqueefington in forum Queries
    Replies: 1
    Last Post: 01-05-2016, 04:20 PM
  3. Cleaning up Queries
    By shifty in forum Queries
    Replies: 1
    Last Post: 04-26-2015, 06:00 PM
  4. Cleaning up a spreadsheet
    By tonydepo in forum Import/Export Data
    Replies: 16
    Last Post: 11-13-2012, 04:27 PM
  5. Cleaning Up Data - Need Help
    By NeedHelp in forum Access
    Replies: 2
    Last Post: 06-05-2010, 10:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums