Access 2007 macro RunCommand

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:

Related 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
Beep
MsgBox .MacroError.Description, vbOKOnly, ""
End If
End With

copyofrecord1_Exit:
Exit Function

copyofrecord1_Err:
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.


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


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?


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.


The 'Copy' RunCommand cannot be run in disabled mode
I have a duplicate record macro button. In Access 2007 it works fine. However, when I convert the file to 2002-2003 format I get the error posted in the title.

I basically added my entire C: drive to the trusted locations, but that didn't do anything


Running excel macro as part of my Access 2007 macro.
everyone,

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


Macros in adp
I am new to Access Projects.

Is it common for the scope of a macro to only be during the current instance of Access? I notice that creation of a macro does not have the subsequent request to save, etc. Then after closing a session of the ADP and reopening the macro no longer exists.

I am using Access 2007. Is there as there is with so many things in 2007, a deeply buried and grossly unintuitive 'new' process of saving macros in 2007? Or as I suspicion no way to preserve macros in an ADP?


RunCommand acCmdSaveRecord
Came across a form that has this code in it's Sub cmdSave_Click() event. It appears twice in succession -

RunCommand acCmdSaveRecord
RunCommand acCmdSaveRecord

The form contains a subform so I can only imagine that it is saving the data for both forms?
Does this make sense? Is this the appropriate way to handle this


Introduction to macros
This article explains what macros are and how they can save you time by automating tasks that you perform often. It explores the fundamentals behind creating and using macros and also touches on improvements to macros in Microsoft Office Access 2007.
In this article: What is a macro? Understand macros; New macro features in Office Access 2007; Create a macro; Run a macro.


Database gets Macro errors after being opened and changed in Access 2007
Anyone,

I have a somewhat intresting issue. My organization is still mostly using Office 2003. Recently, I have been upgraded to 2007. I have been coding and designing an access database application. In access 2007, I have saved the format in 2003 mdb, however, when I open the database in 2003 my autoexec macro will not run. I recieve the "halt" error. Can anyone help me understand what access 2007 changed in my database that would cause my autoexec macro not to run in 2003? I have been searching the internet all morning and yesterday for a solution


Macro action commands XP vs 2007
I recently converted my old databases of Access XP to Access 2007. In the Macro tab, there are new action commands in Access 2007. I wonder if there is a cheat sheet to tell what a similar action command would be in Access 2007 compared to an old Access XP's action command (e.g. 2007's Outputsend coomand is similiar to XP's transfersXXXX command.).


Filter Form doesn't close
I have an Access 2007 form with a command button that does this on the OnClick event:

DoCmd.RunCommand acCmdAdvFilterSort

The filtering form opens correctly and I'm able to specify my criteria. If I right click and choose Apply Filter/Sort, the filtering works BUT the filter form doesn't close. Instead, my Access 2007 form appears in front of it and gets the focus but the filtering form stays open.

I'm using a customized ribbon and have tried two other ways to accomplish this. The first is:

idMso = "ApplyFilter"

The second is a macro that runs a function with this code:


Introduction to macros: Automate tasks
This article explains what macros are and how they can save you time by automating tasks that you perform often. It explores the fundamentals behind creating and using macros and also touches on improvements to macros in Microsoft Office Access 2007.
In this article you'll learn: What is a macro? Understand macros, New macro features in Office Access 2007, Create a macro, Run a macro.


Access 2007 - Macro trouble coverting
someone know if there is a trouble or a bug when you try to convert a macro to a VBA? Because I tried many times, save before, another macro, but I always get a message saying that can not find the macro.


Executing an Access Macro from Excel 2007
Is it possible to execute a Macro on an Access Database from Excel 2007?

If so, could someone advise me on how to do this?

Vik

ps. I don't know any VB Script, so please dumb down your response, if possible