Dear all,
I need some VBA code to import a table (Called Table1) from one access database (Called Database1) to another access database (Called Database2).I found some codes and I modified as below but I got the below error on this line: acExport
Sub ImportTable()
Dim AccessApplication As Object
Dim CurrentDBSourcePath As String
Dim CurrentDBPath As String
Set AccessApplication = CreateObject("Access.Application")
CurrentDBSourcePath = "C:\Database1.accdb"
CurrentDBPath = "C:\Database2.accdb"
AccessApplication.OpenCurrentDatabase CurrentDBSourcePath
AccessApplication.DoCmd.TransferDatabase acExport, "Microsoft Access", CurrentDBPath, acTable, "Table1", "Table2", False
End Sub
Could you give any suggestion on solving the issue or using a different coding?
Thanks