Macro Error Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a macro that is pretty simple, but when executed gives an error
stating the
"Command or action RUN is not available now". I'm sure I'm missing something
simple as I have written macros before without a problem. Any idea what I'm
running into here?

Thanks for any advice,

Ted
 
Would you post some more detail on what commands are in your macro, and what
you are trying to do?

We would be better able to help you.

Rosco
 
Sorry, I was just frustrated and didn't give you much to work with.

It's a pretty simple macro.
Echo - Off
SetWarnings - Off
OpenQuery - [Query1 Name]
RunCommand - Run
Close - Query - [Query1 Name]
OpenQuery - [Query2 Name]
RunCommand - Run
Close - Query - [Query2 Name]
SetWarnings - On
Echo - On

Query1 is a delete query and Query2 is an append query. I'm simply trying to
delete and repopulate a table.

Ted
 
Since your queries are action queries, I don't believe you need the
RunCommand and the CloseQuery commands.

Try this:

Echo - Off
SetWarnings - Off
OpenQuery - [Query1 Name]
OpenQuery - [Query2 Name]
SetWarnings - On
Echo - On

Hope this helps
Rosco


TD11 said:
Sorry, I was just frustrated and didn't give you much to work with.

It's a pretty simple macro.
Echo - Off
SetWarnings - Off
OpenQuery - [Query1 Name]
RunCommand - Run
Close - Query - [Query1 Name]
OpenQuery - [Query2 Name]
RunCommand - Run
Close - Query - [Query2 Name]
SetWarnings - On
Echo - On

Query1 is a delete query and Query2 is an append query. I'm simply trying to
delete and repopulate a table.

Ted



Rosco said:
Would you post some more detail on what commands are in your macro, and what
you are trying to do?

We would be better able to help you.

Rosco
 
Well... that worked and thank you.

I have always built macros using the open-run-close sequence and they have
always worked....until this experience. I appreciate the knowledge. This will
certainly make macros easier/shorter in the future.

Ted

Rosco said:
Since your queries are action queries, I don't believe you need the
RunCommand and the CloseQuery commands.

Try this:

Echo - Off
SetWarnings - Off
OpenQuery - [Query1 Name]
OpenQuery - [Query2 Name]
SetWarnings - On
Echo - On

Hope this helps
Rosco


TD11 said:
Sorry, I was just frustrated and didn't give you much to work with.

It's a pretty simple macro.
Echo - Off
SetWarnings - Off
OpenQuery - [Query1 Name]
RunCommand - Run
Close - Query - [Query1 Name]
OpenQuery - [Query2 Name]
RunCommand - Run
Close - Query - [Query2 Name]
SetWarnings - On
Echo - On

Query1 is a delete query and Query2 is an append query. I'm simply trying to
delete and repopulate a table.

Ted



Rosco said:
Would you post some more detail on what commands are in your macro, and what
you are trying to do?

We would be better able to help you.

Rosco

:

I have a macro that is pretty simple, but when executed gives an error
stating the
"Command or action RUN is not available now". I'm sure I'm missing something
simple as I have written macros before without a problem. Any idea what I'm
running into here?

Thanks for any advice,

Ted
 
Glad to be of help.

Rosco

TD11 said:
Well... that worked and thank you.

I have always built macros using the open-run-close sequence and they have
always worked....until this experience. I appreciate the knowledge. This will
certainly make macros easier/shorter in the future.

Ted

Rosco said:
Since your queries are action queries, I don't believe you need the
RunCommand and the CloseQuery commands.

Try this:

Echo - Off
SetWarnings - Off
OpenQuery - [Query1 Name]
OpenQuery - [Query2 Name]
SetWarnings - On
Echo - On

Hope this helps
Rosco


TD11 said:
Sorry, I was just frustrated and didn't give you much to work with.

It's a pretty simple macro.
Echo - Off
SetWarnings - Off
OpenQuery - [Query1 Name]
RunCommand - Run
Close - Query - [Query1 Name]
OpenQuery - [Query2 Name]
RunCommand - Run
Close - Query - [Query2 Name]
SetWarnings - On
Echo - On

Query1 is a delete query and Query2 is an append query. I'm simply trying to
delete and repopulate a table.

Ted



:

Would you post some more detail on what commands are in your macro, and what
you are trying to do?

We would be better able to help you.

Rosco

:

I have a macro that is pretty simple, but when executed gives an error
stating the
"Command or action RUN is not available now". I'm sure I'm missing something
simple as I have written macros before without a problem. Any idea what I'm
running into here?

Thanks for any advice,

Ted
 
TD11 -

I suggest that you look into learning how to use VBA code, instead of depending on macros. In
the example you gave, if either Query1 Name or Query2 Name ever fails for any reason, your
warnings will remain turned off. There are ways of avoiding this with VBA code, so it's time to
start weaning yourself away from macros.

Tom
___________________________________


Well... that worked and thank you.

I have always built macros using the open-run-close sequence and they have
always worked....until this experience. I appreciate the knowledge. This will
certainly make macros easier/shorter in the future.

Ted

Rosco said:
Since your queries are action queries, I don't believe you need the
RunCommand and the CloseQuery commands.

Try this:

Echo - Off
SetWarnings - Off
OpenQuery - [Query1 Name]
OpenQuery - [Query2 Name]
SetWarnings - On
Echo - On

Hope this helps
Rosco


TD11 said:
Sorry, I was just frustrated and didn't give you much to work with.

It's a pretty simple macro.
Echo - Off
SetWarnings - Off
OpenQuery - [Query1 Name]
RunCommand - Run
Close - Query - [Query1 Name]
OpenQuery - [Query2 Name]
RunCommand - Run
Close - Query - [Query2 Name]
SetWarnings - On
Echo - On

Query1 is a delete query and Query2 is an append query. I'm simply trying to
delete and repopulate a table.

Ted



Rosco said:
Would you post some more detail on what commands are in your macro, and what
you are trying to do?

We would be better able to help you.

Rosco

:

I have a macro that is pretty simple, but when executed gives an error
stating the
"Command or action RUN is not available now". I'm sure I'm missing something
simple as I have written macros before without a problem. Any idea what I'm
running into here?

Thanks for any advice,

Ted
 

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

Back
Top