P
Paul Burdett
Hi Guys
I have the following code trying to link to a database using Access 2000 on
XP Pro and it falls over at the TablDefs.Append line.
Sub CreateLinkedTable()
Dim tbfNewAttached As DAO.TableDef
Dim LocalDB As DAO.Database
Set LocalDB = CurrentDb()
Set tbfNewAttached = LocalDB.CreateTableDef("MyContacts")
With tbfNewAttached
.Connect = ";DATABASE = C:\My_Data.mdb"
.SourceTableName = "tblContacts"
End With
Set LocalDB = CurrentDb()
LocalDB.TableDefs.Append tbfNewAttached 'This is where it complains
End Sub
The message I get is:
'Run time error 3001. Invalid Argument'
I have checked the references for DAO 3.6 and all is OK.
Thoughts welcome
Kind Regards
Paul
I have the following code trying to link to a database using Access 2000 on
XP Pro and it falls over at the TablDefs.Append line.
Sub CreateLinkedTable()
Dim tbfNewAttached As DAO.TableDef
Dim LocalDB As DAO.Database
Set LocalDB = CurrentDb()
Set tbfNewAttached = LocalDB.CreateTableDef("MyContacts")
With tbfNewAttached
.Connect = ";DATABASE = C:\My_Data.mdb"
.SourceTableName = "tblContacts"
End With
Set LocalDB = CurrentDb()
LocalDB.TableDefs.Append tbfNewAttached 'This is where it complains
End Sub
The message I get is:
'Run time error 3001. Invalid Argument'
I have checked the references for DAO 3.6 and all is OK.
Thoughts welcome
Kind Regards
Paul