Topics Search

Access 2007 macro RunCommand

Access 2007 macro RunCommand
Views: 53
I have a Macro that in the old version I had several things going on like SetWarnings, Open and Close 2 queries then OpenModule and its command is MailMod and next statement was RunCommand with a command of Run

When I run the macro it loops through 20 times and give me a error that a Macro can only call itself a maximum of 20 times.

If I run the Bat file I get a error that The command or action “Run” isn’t available now.
Sponsored Links:

More topics


RunCommand Macro Action

You can use the RunCommand action to run a built-in Microsoft Office Access 2007 command.

Access 2007

The runcommand as part of a macro used to have the command RefreshPage in the 2003 version but I cant seem to find it in the 2007 version.

Can anyone tell me if there is an alternative I need to refresh a form by pressing a command button eg. running a macro or vb that refreshed the current form

The command or action 'InsertTableColumn' isn't available now.

I am running an application in 2007 that was developed in an earlier version of Access (might have been 97). When I run a macro that has a RunCommand action with an InsertTableColumn argument the macro halts and I get the message: "The command or action 'InsertTableColunm' isn't available now.

* You may be in a read-only database or an unconverted database from an ealier version of X.

* The type of object the action applies to isn't currently selected or isn't in the active view. Use only those commands and macro actions that are currently available for this database." This macro will run on a workstation with Access 2003, and the database is not read only.

I converted this database to 2007, and also saved another copy of it as 2003, but I still get the error when run under Access 2007.

Macro converted to VBA code

On Error GoTo copyofrecord1_Err

With CodeContextObject
On Error Resume Next
DoCmd.RunCommand acCmdSelectRecord
If (.MacroError = 0) Then
DoCmd.RunCommand acCmdCopy
End If
If (.MacroError = 0) Then
DoCmd.RunCommand acCmdRecordsGoToNew
End If
If (.MacroError = 0) Then
DoCmd.RunCommand acCmdSelectRecord
End If
If (.MacroError = 0) Then
DoCmd.RunCommand acCmdPaste
End If
If (.MacroError <> 0) Then
MsgBox .MacroError.Description, vbOKOnly, ""
End If
End With

Exit Function

MsgBox Error$
Resume copyofrecord1_Exit

Access 2007 - the command or action 'quit' isn't available now

I have some Access programs in 2003 and need to migrate to 2007. I developed some macros in 2003 and the macros will close the Access database at the end with the Quit command, it is all working fine in 2003, but after migrating it to 2007, it no longer works and I am getting the error message as below. I also tried using RunCommand -> Exit, and got the same error message too.

My purpose is to have the Access database automatically close at the end of the macro.

Last Record in macros ACCESS 2007

I used to have a macro that calcultated fields in a form of an application Ive made on ACCESS 2003, from the first to the last record. When I tried it on a computer with ACCESS 2007 the macro doesnt stop. I dont know how to order the macro to stop when it reaches the last record in ACCESS 2007. Can somebody help me, please?

Copy and Paste macro

I need to create a short cut menu in 2007 that will have the copy and paste command. I went to Access help and it showed how to create a shortcut menu using a macro but when I attempted to create this macro I could not find copy or paste in the ACTION column. I also looked in the RunCommand Action arguments and did not find them. I have hidden all the default menus and ribbons but now I need to create a shortcut menu to copy and paste and attach to a form

Macro to filter data

a newcomer here.

I am developing a client database with Access 2007, of which I have little experience. Let me give some background info first.

I have a table which is supposed to show booked dates and the clients who this date have been booked to. Only problem is, it also shows the clients who doesn't have any dates booked for them.

My knowledge in macro limits to RunCommand and that's it. Do you guys have some idea how I would be able to implement a macro that filters out all the clients who doesn't have a booked date.

And apologies if my explanation is a bit unclear, because my native language isn't English. If there is any confusion, then ask and I'll try to be more specific and articulate.

Running excel macro as part of my Access 2007 macro.


I am a bit of a newbie, so I'm not sure how obvious this is. But I am creating an Access 2007 macro at the moment and need some help with it.

One of the actions in my access macro is to export a file to excel and save it. When the excel file is exported, it automatically opens - at this stage I want to run an excel macro that would modify this exported file.

Is there a macro 'action' I could select that would enable me to run an excel macro once this file is exported?

If not, is it possible to open the access macro in VBA and insert some code that would enable me to run an excel macro

SendObject in macro fails to open outlook

In one of my forms (access 2007) I have a button for sending emails to clients with outlook 2007. In the click event of the button I use a macro with the SendObject action. The macro works fine when it is used for first time. However, the next time I try to send an email the whole application (access 2007) freezes and I must use the task manager to close it.

All Office 2007 applications are fully updated