Hi anyone
I'm new to tek-tips, & have a puzzler. With code in a source db in Access 2002 I want to open a target db's Access Modules collection, iterate each module by name, and use the Lines property of the Modules collection to copy the module's code to a table in the source db. Problem is that I only know how to get at the Modules collection for the current db, not the target db. How do I get at the target db's Modules collection? PS: I don't use the AllModules collection because OpenCurrentDatabase actually opens the db, which triggers start ups. I apologize for my wordiness. Anyone know of a way?
The following code is written in source.mdb.
Dim db As Database
Dim doc As Document
Set db = OpenDatabase("c:\temp\target.mdb")
For Each doc In db.Containers("Modules").Documents
MsgBox doc.Name
'WHAT HAPPENS NEXT - How to select target.mdb Module
'objects and use Lines property to copy the code to
'source.mdb?
Next
I'm new to tek-tips, & have a puzzler. With code in a source db in Access 2002 I want to open a target db's Access Modules collection, iterate each module by name, and use the Lines property of the Modules collection to copy the module's code to a table in the source db. Problem is that I only know how to get at the Modules collection for the current db, not the target db. How do I get at the target db's Modules collection? PS: I don't use the AllModules collection because OpenCurrentDatabase actually opens the db, which triggers start ups. I apologize for my wordiness. Anyone know of a way?
The following code is written in source.mdb.
Dim db As Database
Dim doc As Document
Set db = OpenDatabase("c:\temp\target.mdb")
For Each doc In db.Containers("Modules").Documents
MsgBox doc.Name
'WHAT HAPPENS NEXT - How to select target.mdb Module
'objects and use Lines property to copy the code to
'source.mdb?
Next