I've got that FIXED... however now it keeps copying the Econ Form.
I'm not sure where or how to rtell it to step through, but here's my best
guess
Here the Mod with my guess in <>
Public Sub ObjectsTbl()
' Code Modified to Import into access 2003 from Access '97
Dim Db As DAO.Database
Dim Cont As DAO.Container
Dim Doc As DAO.Document
Dim Rs As DAO.Recordset
Dim ObjType As thObjType
Dim FromDb As DAO.Database
Set FromDb = Access.DBEngine.OpenDatabase("D:\D:\Dev\StageingDb.mdb")
Set Db = Access.CurrentDb()
Set Rs = FromDb.OpenRecordset("SELECT NAME, TYPE FROM USysObjects",
DAO.dbOpenSnapshot)
While Not Rs.EOF
Select Case Rs.Fields("Type").Value
Case thObjType.thTable
Set Cont = FromDb.Containers("Tables")
Set Doc = Cont.Documents(Rs.Fields("Name").Value)
ObjType = GetObjType(Cont.Name)
Case thObjType.thQuery ' Special Case !!!
Set Cont = FromDb.Containers("Tables")
Set Doc = Cont.Documents(Rs.Fields("Name").Value)
ObjType = GetObjType("Queries")
Case thObjType.thMacro
Set Cont = FromDb.Containers("Scripts")
Set Doc = Cont.Documents(Rs.Fields("Name").Value)
ObjType = GetObjType(Cont.Name)
Case thObjType.thForm
Set Cont = FromDb.Containers("Forms")
Set Doc = Cont.Documents(Rs.Fields("Name").Value)
ObjType = GetObjType(Cont.Name)
Case thObjType.thReport
Set Cont = FromDb.Containers("Reports")
Set Doc = Cont.Documents(Rs.Fields("Name").Value)
ObjType = GetObjType(Cont.Name)
Case thObjType.thModule
Set Cont = FromDb.Containers("Modules")
Set Doc = Cont.Documents(Rs.Fields("Name").Value)
ObjType = GetObjType(Cont.Name)
End Select
Access.Application.DoCmd.TransferDatabase acImport, "Microsoft Access",
FromDb.Name, ObjType, Doc.Name, Doc.Name
<next RS.Fields("Name")>
Wend
Rs.Close: Set Rs = Nothing
FromDb.Close: Set FromDb = Nothing
Set Db = Nothing
End Sub
OH FYI - the fix for the last error - I had somehow removed Cont.Documents(
from in front of RS.Fields("Name").Value - and it was only missing from the
Forms
section.
======================================