RichardMGreen
Well-known Member
- Joined
- Feb 20, 2006
- Messages
- 2,177
Hi all
I want to change the filepath of a linked table in VBA.
So far I've got this:-
As far as I can make out, checking the Connect property tells me if it's a linked table, but I'm not sure how to change just the path part.
Can someone point me in the right direction please?
::edit::
I also found this code which will change the entire string:-
td.Connect = "MS Access;Database=C:\MyBackEnd.mdb;"
td.RefreshLink
(this is changing a table linked to another Access file but I'm linking to CSV files)
but do I need to do a refreshlink for each table individually or can I do them all at once at the end of the loop?
I want to change the filepath of a linked table in VBA.
So far I've got this:-
Code:
Sub test()
Dim tbl As TableDef
For Each tbl In TableDefs
If Len(tbl.Connect) > 0 Then
End Sub
As far as I can make out, checking the Connect property tells me if it's a linked table, but I'm not sure how to change just the path part.
Can someone point me in the right direction please?
::edit::
I also found this code which will change the entire string:-
td.Connect = "MS Access;Database=C:\MyBackEnd.mdb;"
td.RefreshLink
(this is changing a table linked to another Access file but I'm linking to CSV files)
but do I need to do a refreshlink for each table individually or can I do them all at once at the end of the loop?
Last edited: