Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Ottawa, Ontario, Canada; West Palm Beach FL

    Thanks for all responses and code. I agree that the information in this area is quite obscure. I was looking at some code using VBIDE and thought there must be a way to do list modules and procs in "more standard" vba. In fact, after trying things that "looked" OK, and when they failed with a variety of errors, I knew I had seen code/article in the past that referred to this sort of thing. I did find code dated 2017 that is very similar to the AllProcs in Vlad's code in post #10. It had comments showing "from the internet possibly Brent Spalding".

    Anyway, I appreciate the info and the link. This thread may just help someone dealing with this "obscure" topic area.

    Thanks all.

  2. #17
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Ottawa, Ontario, Canada; West Palm Beach FL
    Although this isn't the same topic that this thread started with, it may offer some insight into Containers and Documents discussed/discovered in the thread. After looking at the M$oft material on Container and Document, the attached is a sample of Containers and Documents in my test database. This is a modification of an example.

    ' ----------------------------------------------------------------
    ' Procedure Name: ContainerPropertyX
    ' Purpose: Display the Container names and the name of each
    '          Document in the Container's Documents Collection
    '          in the current database
    '  **Note: Not all Containers have documents
    ' Procedure Kind: Sub
    ' Procedure Access: Public
    ' Author: Jack /based on M$oft Example
    ' Date: 19-Mar-23
    ' ----------------------------------------------------------------
    Sub ContainerPropertyX()
              Dim dbs As Database
              Dim ctrLoop As Container
              Dim doc As Object
    10        Set dbs = CurrentDb
    20        Debug.Print "Containers and Documents in " & CurrentProject.Name & vbCrLf
    30        For Each ctrLoop In dbs.Containers
    40        Debug.Print "Container Name: " & ctrLoop.Name
    50            On Error Resume Next
    60            For Each doc In ctrLoop.Documents
    70                    Debug.Print ".... " & "DocumentName: " & doc.Name
    80            Next doc
    90        Next ctrLoop
    100       dbs.Close
    End Sub
    This is the output from the test database .

    Containers and Documents in NoComm2.accdb

    Container Name: DataAccessPages
    Container Name: Databases
    .... DocumentName: MSysDb
    .... DocumentName: SummaryInfo
    .... DocumentName: UserDefined
    Container Name: Forms
    Container Name: Modules
    .... DocumentName: basStripComments
    .... DocumentName: ModAjax
    .... DocumentName: ModAjax2
    .... DocumentName: ModAjax3
    .... DocumentName: ModDaveGri ..............<<I did create a module and try Dave's code
    .... DocumentName: ModFromMyOKDB
    .... DocumentName: ModMSoftContainerEtc
    .... DocumentName: ModuleTest
    .... DocumentName: ModVlad
    .... DocumentName: MYWorkONA97
    Container Name: Relationships
    .... DocumentName: MSysNavPaneGroupCategoriesMSysNavPaneGroups
    .... DocumentName: MSysNavPaneGroupsMSysNavPaneGroupToObjects
    Container Name: Reports
    Container Name: Scripts
    Container Name: SysRel
    Container Name: Tables
    .... DocumentName: MSysAccessStorage
    .... DocumentName: MSysACEs
    .... DocumentName: MSysComplexColumns
    .... DocumentName: MSysNameMap
    .... DocumentName: MSysNavPaneGroupCategories
    .... DocumentName: MSysNavPaneGroups
    .... DocumentName: MSysNavPaneGroupToObjects
    .... DocumentName: MSysNavPaneObjectIDs
    .... DocumentName: MSysObjects
    .... DocumentName: MSysQueries
    .... DocumentName: MSysRelationships
    .... DocumentName: MSysResources
    .... DocumentName: TemplateForUSysRegInfo
    Last edited by orange; 03-19-2023 at 10:19 AM. Reason: lost formatting, modified the debug.print

  3. #18
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Ottawa, Ontario, Canada; West Palm Beach FL
    Thanks for responding. I created a module for your code and tested it with the test database. It compiles, but errors on Set mdl = Modules(strModuleName). 7961 --can't find the module...

    I added this in the ListOfProcs and a debug.print of strMsg and it worked.

     Dim strMsg As String
        DoCmd.OpenModule strModuleName ''''''''''''''''''added
        Set mdl = Modules(strModuleName)

    These are the results.

    Module line count basStripComments 201
    Procedures in the Module: basStripComments

    Module line count ModAjax 26
    Procedures in the Module: ModAjax

    Module line count ModAjax2 30
    Procedures in the Module: ModAjax2

    Module line count ModAjax3 30
    Procedures in the Module: ModAjax3

    Module line count ModDaveGri 68
    Procedures in the Module: ModDaveGri

    Module line count ModFromMyOKDB 159
    Procedures in the Module: ModFromMyOKDB

    Module line count ModMSoftContainerEtc 79
    Procedures in the Module: ModMSoftContainerEtc

    Module line count ModuleTest 15
    Procedures in the Module: ModuleTest

    Module line count ModVlad 27
    Procedures in the Module: ModVlad

    Module line count MYWorkONA97 208
    Procedures in the Module: MYWorkONA97

  4. #19
    davegri's Avatar
    davegri is online now Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Who knows? On my machine with Access 2019, opening the module is not required. Life goes on....

  5. #20
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Ottawa, Ontario, Canada; West Palm Beach FL
    I agree Dave. I'm running Access 365 Version 2302 - Build 16.0.16130.20306 64-bit Click to run

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Intermittant #Type! type mismatch error.
    By Ranger351w in forum Programming
    Replies: 4
    Last Post: 09-27-2020, 07:53 PM
  2. Type 13 (Type Mismatch) error
    By sdel_nevo in forum Programming
    Replies: 5
    Last Post: 01-22-2016, 10:01 AM
  3. Type Mismatch
    By Alex Motilal in forum Programming
    Replies: 10
    Last Post: 02-13-2011, 05:42 AM
  4. Type mismatch
    By jgelpi16 in forum Programming
    Replies: 1
    Last Post: 08-07-2010, 06:54 AM
  5. Type Mismatch - HELP!
    By jgelpi in forum Programming
    Replies: 3
    Last Post: 07-17-2009, 03:53 PM

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