Hi All,
I am trying to write a VBA Code that does the same job as 'Append Data To Existing Table' option, while copy-pasting a Table within the same DB. I have tried my luck with:
DoCmd.TransferDatabase acExport, "Microsoft Access", CurrentDb.Name, acTable, "Tbl_ApplCnt", "Tbl_ApplCnt_Unique", StructureOnly:=True
CurrentDb.Execute "CREATE UNIQUE INDEX assetnum ON Tbl_ApplCnt_Unique (assetnum) WITH PRIMARY"
DoCmd.TransferDatabase acExport, "Microsoft Access", CurrentDb.Name, acTable, "Tbl_ApplCnt", "Tbl_ApplCnt_Unique", StructureOnly:=False
However, when I try: StructureOnly:=False I end up pasting the entire table again & my effort to create a primary key (& hence a result table with Unique 'assetnum') fails.
I need something like: AppendDataToExistingTable:=True
I have tried Google one entire day, yet came up with nothing. :banghead:
I promise to include the 'helper' in my prayers every day. Pls help.
I am trying to write a VBA Code that does the same job as 'Append Data To Existing Table' option, while copy-pasting a Table within the same DB. I have tried my luck with:
DoCmd.TransferDatabase acExport, "Microsoft Access", CurrentDb.Name, acTable, "Tbl_ApplCnt", "Tbl_ApplCnt_Unique", StructureOnly:=True
CurrentDb.Execute "CREATE UNIQUE INDEX assetnum ON Tbl_ApplCnt_Unique (assetnum) WITH PRIMARY"
DoCmd.TransferDatabase acExport, "Microsoft Access", CurrentDb.Name, acTable, "Tbl_ApplCnt", "Tbl_ApplCnt_Unique", StructureOnly:=False
However, when I try: StructureOnly:=False I end up pasting the entire table again & my effort to create a primary key (& hence a result table with Unique 'assetnum') fails.
I need something like: AppendDataToExistingTable:=True
I have tried Google one entire day, yet came up with nothing. :banghead:
I promise to include the 'helper' in my prayers every day. Pls help.
Attachments
Last edited: