Search through mods and cbf

Guus2005

AWF VIP
Local time
Today, 04:46
Joined
Jun 26, 2007
Messages
2,636
I want to create a crossreference function to search for a string in my code or CBF. Like i have done for table names:
Which tables are used in queries:
Code:
Public Sub XrefTablesInQueries(Optional blnUsed As Boolean = False)
'Loop through all tables to see if their name is used in queries.
'Default only the tables not used in queries are shown.

    Dim tdf      As TableDef
    Dim blnFound As Boolean
    
    For Each tdf In CurrentDb.TableDefs
        If VBA.Left$(tdf.Name, 4) <> "MSys" Then
            blnFound = SearchInQueryDefs(tdf.Name, True)
            If blnFound And blnUsed Then
                Debug.Print "In use: "; tdf.Name
            ElseIf Not blnFound And Not blnUsed Then
                Debug.Print "Not in use: "; tdf.Name
            End If
        End If
    Next tdf
    MsgBox "Done!", vbInformation, "XrefTables: Search completed"
End Sub

I want to know if a certain query was used in my modules and/or CBF.
 
Great!

I searched the internet but couldn't find it. I really appreciate this!
Now i can create my SortProcedures function. Like MZTools does.

Thank You!:p
 

Users who are viewing this thread

Back
Top Bottom