- Local time
- Today, 17:57
- Joined
- Feb 19, 2002
- Messages
- 46,883
I'm working on my documentation tool and moving into unchartered waters. Up to now, I've been working with DAO objects and so having no trouble referencing them. Now I want to reference code and I found some useful code but it works for the current db. I need to figure out how to change the reference to a different db.
I need to access tables in the code db because that is where the logging is done and I also have a reference to a foreign db because those are the table properties I am documenting.
So, this gives me a ThisDB to reference anything in the db running the code and db to reference anything in the database I am analyzing.
The code I found uses this reference:
I need to figure out how to change Application.VBE.ActiveVBProject to reference the "other" db rather than the current db so I can look at the code in THAT db. All I am doing for now is listing the module names and the lines of code. The sample code works great for "this" database.
Thanks for helping
I need to access tables in the code db because that is where the logging is done and I also have a reference to a foreign db because those are the table properties I am documenting.
Code:
Set ThisDB = CurrentDb()
If strDatabase = "" Then
Set db = CurrentDb()
Else
Set db = DBEngine.Workspaces(0).OpenDatabase(strDatabase)
End If
db.Containers.Refresh
The code I found uses this reference:
Code:
Dim basModule As VBComponent
....
....
For Each basModule In Application.VBE.ActiveVBProject.VBComponents
Thanks for helping