Topics Search

Access 2007 macro RunCommand

Access 2007 macro RunCommand
Views: 61
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:

Similar posts...

 

RunCommand Macro Action

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

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

The command or action 'InsertTableColumn' isn't available now. Icon
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.
 

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

Access 2007 - the command or action 'quit' isn't available now Icon
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.
 

SendObject in macro fails to open outlook

SendObject in macro fails to open outlook Icon
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
 

Macro converted to VBA code

Macro converted to VBA code Icon
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
 

Introduction to macros

Introduction to macros Icon
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.
 

Introduction to macros: Automate tasks

Introduction to macros: Automate tasks Icon
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.
 

Filter Form doesn't close

Filter Form doesn't close Icon
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:
 

Executing an Access Macro from Excel 2007

Executing an Access Macro from Excel 2007 Icon
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
 

Macro wizard in access 2007

Macro wizard in access 2007 Icon
How do I start a macro wizard in access 2007?

How do I make a macro for copying data from one form to another form