DoCmd.CopyObject for backend table / Pivot Tables

K

Kevin Witty

What I'm trying to do here is allow the user to create customized pivot
tables, and save them with a new name in the back end. My code writes the
appropriate SQL to empty and re-populate the table, but what I'm having
trouble with is the CopyObject syntax.

My code opens the backend table in PivotTable view. The user can then fuss
with it as required, and when finished, saves it. I want to then prompt the
user for a new name, and copy the saved table to that name. I thought
DoCmd.CopyObject would do that, but so far it's not.

From the front end, I'm using

DoCmd.CopyObject FullPathToBackEnd, NewTableName, acTable,OldTableName

i.e., DoCmd.CopyObject
"s:\MyApps\MyBackend\MyBackend.mdb","NewPivotTableName", acTable,
"OldPivotTableName"

but it doesn't seem to work. The new tablename doesn't appear in the back
end.

What am I doing wrong???

(I'm also assuming that CopyObject will copy the PivotTable specs with it,
but that may be a wrong assumption, too. Any other ideas on this?)

Thanks,

Kevin
 

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