Question How to create a script to handle multiple access actions

dealwi8me

Registered User.
Local time
Today, 18:30
Joined
Jan 5, 2005
Messages
187
Hello,
Is it possible to create a script which will do the following?

1. Copy file1.mdb from location A to location B
2. Import Query1 in file2.mdb to location B
3. Import Macro1 in file2.mdb to location B
4. Run Query1 and Macro1 in file2.mdb

Any ideas?

Thank you in advance!
 
Sure its possible, if executing it from File2.mdb....

But why import the Macro and query tho?? I cannot see a reason to do this automated... the query and macro should be there by default.
Why use a macro and not do it all in code?

FileCopy will copy any file anywhere anytime
Currentdb.Execute will run your (action) query (i.e. make table etc)
Docmd.OpenQuery will run your (non-action) query
DoCmd.RunMacro will start your Macro

Good luck!
 
Thank you for answering!

What i need to do is to prepare a script that merges two databases into one (something like replication).
When the user gets both databases from diffrent location, i want the script to put them into spesific location and merge them.

Macro will run all the SQL commands in order to merge each table.
 
Why copy the DB at all? And not just fetch the data from the place where the DB currently is?

You should be good to go tho with the suggestions I have given.
 

Users who are viewing this thread

Back
Top Bottom