Run a macro and pause before running second macro




I created an Import table macro and a rename macro . I also created a form
that gets data from a query associated with the table that is imported
(tblTest). The import table macro runs the (rename macro and also opens this
form). I added time interval to the form so that the Import Table Macro will
run every 5 mins.

When the Import Table Macro runs I get this error message =>(The Db engine
could not lock tblTest because it is already in use by another person or
process). If I run the macros separately they run fine.

The Import macro pulls data in from a SQL server table and creates a table
(tblTest). I run the import macro again so that I will have a table name
(tblTest1). Then I run the Rename macro to rename (tblTest1) to (tblTest) so
that the query will pull the current data in.

Any thoughts on why the macros will not run together/what the error message
means will be greatly appreciated.



Hello again,

I noticed that the macros ran fine together when I removed the OpenForm
command from the Import macro. The error pops up when the form is open. Any
ideas why that happens?


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