Hi experts,
Could u please tell me how to use this function:
Public Sub CreateLinkedTable(strLinkedTableName As String _
, strSourceTable As String _
, strConnectString As String)
'Create a linked table
Dim tdf As DAO.TableDef
'Create the linked table
With CurrentDb
'Instantiate the table
Set tdf = .CreateTableDef(strLinkedTableName)
'Set the properties of importance
tdf.Connect = strConnectString
tdf.SourceTableName = strSourceTable
'Append the object to the collection
.TableDefs.Append tdf
End With
'Refesh the navigation pane/db window
RefreshDatabaseWindow
End Sub
The table that i need to re-link with it is table2
Any help would be welcomed,
Could u please tell me how to use this function:
Public Sub CreateLinkedTable(strLinkedTableName As String _
, strSourceTable As String _
, strConnectString As String)
'Create a linked table
Dim tdf As DAO.TableDef
'Create the linked table
With CurrentDb
'Instantiate the table
Set tdf = .CreateTableDef(strLinkedTableName)
'Set the properties of importance
tdf.Connect = strConnectString
tdf.SourceTableName = strSourceTable
'Append the object to the collection
.TableDefs.Append tdf
End With
'Refesh the navigation pane/db window
RefreshDatabaseWindow
End Sub
The table that i need to re-link with it is table2
Any help would be welcomed,