Access 2003
Hello,
Well, I opened my mouth and got handed a task. Here's what I'm trying to do:
I'm trying to import all objects from one Access database to another. This works great with tables and queries, as I'm able to reference the TableDef and QueryDef objects and iterate through them (see code below). The transfer routines are a little cumbersome but work OK.
So yeah, I can get all the tables and queries from one database to the current. No Prob. But now they want goodies like Forms, Reports, Pages, Macros, and Modules as well.
Now I know the DoCmd.TransferDatabase will pull these out no problem, but it needs an object name to reference in order to grab it. Without a collection container (like the TableDefs object), I have no way of iterating through the remote databases objects and pulling them out.
I need like uh.... a ModuleDefs collection!!
<somebody please help!>
Thanks in advance,
Jason
Hello,
Well, I opened my mouth and got handed a task. Here's what I'm trying to do:
I'm trying to import all objects from one Access database to another. This works great with tables and queries, as I'm able to reference the TableDef and QueryDef objects and iterate through them (see code below). The transfer routines are a little cumbersome but work OK.
Code:
'Import Tables
For Each tdf In dbsImport.TableDefs
If Not IsSystemObject(tdf.Name) Then
DoCmd.TransferDatabase acImport, "Microsoft Access", NewDatabaseFile, acTable, tdf.Name, tdf.Name, False, False
End If
DoEvents
Next
So yeah, I can get all the tables and queries from one database to the current. No Prob. But now they want goodies like Forms, Reports, Pages, Macros, and Modules as well.
Now I know the DoCmd.TransferDatabase will pull these out no problem, but it needs an object name to reference in order to grab it. Without a collection container (like the TableDefs object), I have no way of iterating through the remote databases objects and pulling them out.
I need like uh.... a ModuleDefs collection!!
<somebody please help!>
Thanks in advance,
Jason