hello everyone,
I'm trying to write a VBA module that changes referenced tables to different DBs in different folders, and takes the data for those references from a table.
The main code is this part:
The .connect line works great, and exactly how I want it to. However, I seem to be unable to change the SourceTableName, as that line gives me Error 3268: Property cannot be changed if it is part of a list (roughly translated).
Therefore, I can update the .connect line and connect to new DBs by deleting the SourceTableName line, but the new source table needs to have the same name as the old one.
Any ideas how I can update a TableDef.SourceTableName property in such a manner?
thanks in advance
Bani
I'm trying to write a VBA module that changes referenced tables to different DBs in different folders, and takes the data for those references from a table.
The main code is this part:
Code:
Do Until RS_References.EOF
For i = 0 To db.TableDefs.Count - 1
If db.TableDefs(i).Name = RS_References!Name And RS_References!Create_Reference = True Then
db.TableDefs(i).Connect = ";DATABASE=" & RS_References!New_Country_DB
db.TableDefs(i).SourceTableName = RS_References!New_Country_Table
db.TableDefs(i).RefreshLink
End If
Next i
The .connect line works great, and exactly how I want it to. However, I seem to be unable to change the SourceTableName, as that line gives me Error 3268: Property cannot be changed if it is part of a list (roughly translated).
Therefore, I can update the .connect line and connect to new DBs by deleting the SourceTableName line, but the new source table needs to have the same name as the old one.
Any ideas how I can update a TableDef.SourceTableName property in such a manner?
thanks in advance
Bani