Last module in macro not completing

G

Guest

Hello:

A mystery: I have a macro that runs a 3 to 4 minute process. Near the end,
the macros runs code that copies / archives a query to two destinations. When
the module for this is run by itself, all works fine. But it doesn't run from
within the macro. I have double checked how the OpenModule, RunCode, Close
steps are filled out (with procedures & functions) and the problem is not
there. Could anything else be preventing this? The steps that follow this
OpenModule steps are:
SetWarnings/Yes
Close/[This macro]
Quit/Save All.

Thanks, G.
 
V

Van T. Dinh

I think you need the RunCode Macro action, not the OpenModule Macro action.

Check Access Help for the RunCode Macro action.
 
G

Guest

Hi Van:

Actually, I have both. I believe both are required:

Open Module (designate module & procedure)
RunCode (designmate function; called by procedure)
Close (Macro).

Any other ideas?

Van T. Dinh said:
I think you need the RunCode Macro action, not the OpenModule Macro action.

Check Access Help for the RunCode Macro action.

--
HTH
Van T. Dinh
MVP (Access)



Bettergains said:
Hello:

A mystery: I have a macro that runs a 3 to 4 minute process. Near the end,
the macros runs code that copies / archives a query to two destinations.
When
the module for this is run by itself, all works fine. But it doesn't run
from
within the macro. I have double checked how the OpenModule, RunCode, Close
steps are filled out (with procedures & functions) and the problem is not
there. Could anything else be preventing this? The steps that follow this
OpenModule steps are:
SetWarnings/Yes
Close/[This macro]
Quit/Save All.

Thanks, G.
 
V

Van T. Dinh

Not sure but my guess is that the Macro actions are executed asynchronously
with VBA code and the Close Macro action may have stopped the VBA code.

I hardly use Macros except for AutoKeys and usually, the only Macro action
is RunCode and then I control everything in VBA.
 
S

Steve Schapel

Bettergains,

This is not correct, unless I am missing something. I don't know what
the OpenModule and Close actions are supposed to achieve, but on the
face of it, this macro doesn't make sense. If you could give more
details, someone may be able to assist further.
 
G

Guest

Hi Steve:

Yep, to clear up what I've written below, the close action closes the
module, not the macro. Please see more detail I've provided in the reposted
thread "Reposting: how to avoid macro cancelling an export?"

Thanks, G
 

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