Copy Table Data Macro To Another Database

TimTDP

Registered User.
Local time
Today, 13:50
Joined
Oct 24, 2008
Messages
213
Is it possible to copy a table data macro from one data base to another?

I have a database that I use for development. Once happy with the development, I copy the changes over to a live database. With the backend (data) database I have developed a database that compares the development database to the live database, so I know what changes need to be made. This database also makes the changes to the live database.

With 2010 Access has introduced table based data macro's, which I want to start using. How can I copy these from the development database to the live database? At this stage I simply want to copy / import them. I will look at automating the process later!
 
I believe you can export the table itself which also take the data macros along, since it's attached to the table itself. There is no supported mechanism for a standalone import/export of just data macros in UI. In code it should be possible either using SaveAsAXL/LoadFromAXL or SaveAsText/LoadFromText but I've yet to had success with those and that doesn't handle the issues of not being able to enumerate data macros as one can enumerate tables or queries.

There is one way, though that works well enough if you only have one or two data macros:

Open both database at same time, and go to the data macro editor by either selecting the appropriate event or (in old: editing a named data macro / in new: create a new named data macro), then in old, select all macros, press ctrl+c to copy then in new but blank data macro, press ctrl+v to paste.
 
This is ridiculous but i found a workaround.

open both databases. (one in each window)
Select the tables, queries, forms, etc and copy them with CTRL-C (single or multiple items) from the source database.
then from the source database, click file then new. (which essentially closes the source database but keeps the copied items to the clipboard still)
then switch to the destination database and paste the items there. with CTRL-V.
That should copy everything. But it will overwrite the destination tables, queries, forms if they are the same name.
 

Users who are viewing this thread

Back
Top Bottom