I have the code below to import tables from my Master database to my Dummy database.
The problem i have is the the Master database table is a link to a SQL table, and i want it to convert to a local table (Taking too long to pull data from SQL Server), and not just copy the link.
Is there are way using the code below to convert the link to a local table - or am i best just creating a make table query to make a local table ?
The problem i have is the the Master database table is a link to a SQL table, and i want it to convert to a local table (Taking too long to pull data from SQL Server), and not just copy the link.
Is there are way using the code below to convert the link to a local table - or am i best just creating a make table query to make a local table ?
Code:
Function GetLatestData()
Dim Index As Recordset
Dim i As Integer
Dim TableSet As Integer
Set Index = CurrentDb.OpenRecordset("SELECT * FROM tblImportTables;")
If Not Index.EOF Then
Index.MoveLast
TableSet = Index.RecordCount
Index.MoveFirst
While Not Index.EOF
i = i + 1
If ObjectExists(Nz(Index("Table_Name"), "")) Then
DoCmd.DeleteObject acTable, Nz(Index("Table_Name"), "")
End If
DoEvents
DoCmd.TransferDatabase acImport, "Microsoft Access", LiveDB, acTable, Nz(Index("Table_Name"), ""), Nz(Index("Table_Name"), ""), False
DoEvents
Index.MoveNext
Wend
End If
Index.Close
Set Index = Nothing
DoEvents
End Function