Link to home
Start Free TrialLog in
Avatar of Derek Brown
Derek BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Removing HasModule

I'm trying to create an ACCDE file from an Access 2016 DB. I get error Too many objects. I have about 400 objects queries forms reports etc.. Reading the help for the error it says that if Forms Reports etc. have HasModule set to Yes it doubles the number of objects that Access counts. Is there way to remove HasModule or set it to no so that I can try to create an ACCDE file. AS there are so many I wondered if code like this exists:

    Dim obj As Object
    Dim I As Integer
   
    'Forms
    For Each obj In CurrentProject.AllForms
        Application.acForm , obj.Name, bHideUnhide  (replace with something like HasModule=False)
    Next obj

    'Reports
    For Each obj In CurrentProject.AllReports
        Application.SetHiddenAttribute acReport, obj.Name, bHideUnhide  (replace with something like HasModule=False)
    Next obj
ASKER CERTIFIED SOLUTION
Avatar of Daniel Pineault
Daniel Pineault

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To the best of my knowledge, there is no way to query whether a code module exists for an event which contains no code and can be deleted.

You could probably create some code to iterate through the Documents object, and iterate through all of the procedures in each object (form, reports, and modules), but that would be A LOT of work.  

I agree with Jim and Daniel that your first step should be to decompile the application (or import all objects into a new database) and then attempt to compile it.  That should clear out all of the dead wood, which would allow you to create the ACCDE file.