Execute Series of Action Queries

chancer1967

Excel jockey
Local time
Today, 19:00
Joined
Mar 31, 2004
Messages
28
Simple macro (i hope)

I have inherited a user-unfriendly database and am trying to make it easier to use and more robust

Included in the instructions is the following:

1. open table xyz and delete all the records
2. run query update1 (its an append query that writes to xyz)
3. run query update2
4. run query update3
5. run query update4


Im figuring there must be a very easy way to automate all of 1-5 in a macro and attach it to a button on a switchboard.

correct?


thanks!!
 
Make a delete query, the SQL should be like this, and save it.

Code:
DELETE * FROM [b]xyz[/b];

You can have a macro that does these operations:

Setwarnings (set to No)
OpenQuery "deletequery"
OpenQuery "Update1"
OpenQuery "Update2"
OpenQuery "Update3"
OpenQuery "Update4"
Set warnings (set to Yes)

Save the macro as autoexec.
 
or you could create a Function with error handling and use the .Execute method, just call the function from an AutoExec macro or in the on click event of a button
 

Users who are viewing this thread

Back
Top Bottom