CopyObject / Transferspreadsheet help

G

Guest

Hi guys,

I am hoping someone can tell me why when I backup my table using
CopyObject then transferspreadsheet an excel sheet into the table, the
changes are reflected in the backup table as well. i don't understand b/c i
do the copy first.

'delete backup table
DoCmd.DeleteObject acTable, "tblAIMBackup"

'Backup AIM Fund Table before each new import of monthly spreadsheet
DoCmd.CopyObject '"tblAIMBackup", acTable, "tblAIMFund"

'import new month template
DoCmd.TransferSpreadsheet acImport, 8, "tblAIMFund", strInputFileName,
True

(note: both tables are on the backend server and linked to my frontend.)


Thanks,
Matt
(access 2000)
 
G

Guest

Matt,

Have you realised that the TransferSpreadsheet does not overwrite the table
content of the table you are importing to? Instead it appends the new data.
Could this be your problem?
Or are you just importing the, let's say, sales from the last month and want
to add them to the sales figures from previous months?

Beside a typo in the CopyObject line : ' instead of , the VBA code looks o.k.

Regards,
Bernd
 
G

Guest

Thanks for responding to my question. I do know that transferspreadsheet is
adding to my original table, That is why i am confused about what is going
on. I want to copy my original table to a backup and then add records to my
original table. However, say my transferspreadsheet method added 3 records to
my original table. I also see it added 3 records to my backup table too and I
don't know why. Should I close the backup table after the copyobject and
before the transferspreasheet or is it just some weird quirk???
 
G

Guest

I am pretty sure it has to do with being linked tables. I have to find a way
for both those BE tables being linked to my FE without being linked together
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top