Avatar of SteveL13
Flag for United States of America

asked on 

Trying to export a table to another Access database file

I'm trying to export a table to an external Access database file via VBA code.  The code I'm trying is:

DoCmd.TransferDatabase acExport, "Microsoft Access", LFilename, acTable, "qryHeaderRecordsToArchive", "tblDataHeader- & Me.txtFileNameAndLocation, False"

But it isn't working.  Note LFilename is establish with:

LFilename = DLookup("[ArchiveFileLoc]", "tblSetup") & "\" & Me.txtFileNameAndLocation & ".accdb"

So I'm hoping to get the exported file table to be named tblDataHeader PLUS Me.txtFileName

In other words tblDataHeader-something  (something being the  Me.txtFileNameAndLocation  part of it.
Microsoft Access

Avatar of undefined
Last Comment

8/22/2022 - Mon