I am using the following VBA code to copy a db table to another db:
DoCmd.TransferDatabase transfertype:=acExport, _
databasetype:="Microsoft Access", _
databasename:=FileDest, _
ObjectType:=acTable, Source:="Entries", _
Destination:="Entries", structureonly:=True
My goal is to update a destination table structure with the source table structure (both have same db structure, just different records). I have added one field at the end on the table and tried to run the code expecting the new field to appear in the destination table. Instead, the field appeared but all records were deleted.
In fact, the same thing happens with a straight copy-and-paste selecting "structure only". Again, these tables have exactly the same structure except I have added one field in the source table.
This code works quite nicely for forms, reports, and queries, or tables where structureonly = false, but not for tables when all I want is the structure.
What am I missing?