473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Error in Access07 when running DoCmd.RunMacro "MyMacro.MacroSub" , 1

11
Hello,
I am trying to run a macro in that was created in an earlier version of access but getting an error message when i try to run it in 2007. The error occurs on the DoCmd.RunMacro "M_Report2007.ConsumerMoSalesR" , 1 line. Below is the VB scripting and error message. not sure if i need to create individual macro modules to be able to complete the commands but any help is appreciated.

ERROR:

Run-time Error '2501':
The RunMacro action was cancelled.
(END) (DEBUG)

CODE:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Cancel_Click()
  2.      DoCmd.Close
  3. End Sub
Expand|Select|Wrap|Line Numbers
  1.  Private Sub Form_Open(Cancel As Integer)
  2. 'If Not bInReportOpenEvent Then
  3.    ' If we're not called from the report
  4.    'MsgBox "For use from the Sales Goals Report only", vbOKOnly
  5.    'Cancel = True
  6. 'End If
  7. 'Form_Open_Exit:
  8.    'Exit Sub
  9. End Sub
Expand|Select|Wrap|Line Numbers
  1. Private Sub OK_Click()
  2.     If (Eval("[Forms]![F_Sales_Month DialogC].[CMonthC] Is Null")) Then
  3.         '  is MISSING !
  4.         Beep
  5.         MsgBox "Current Month Value is MISSING !      Please Enter...........", vbOKOnly, ""
  6.         Exit Sub
  7.     End If
  8.     If (Eval("[Forms]![F_Sales_Month DialogC].[NMonthC] Is Null")) Then
  9.         '  is MISSING !
  10.         Beep
  11.         MsgBox "Next Month Value is MISSING !      Please Enter...........", vbOKOnly, ""
  12.         Exit Sub
  13.     End If
  14.  
  15.    Me.Visible = False
  16.    DoCmd.RunMacro "M_Report2007.ConsumerMoSalesR", 1
  17. End Sub
Dec 25 '08 #1
7 9052
nico5038
3,080 Expert 2GB
Hard to determine the cause as the macro is missing. Best to transform the macro into code to see where it goes wrong.

Nic;o)
Dec 25 '08 #2
missinglinq
3,532 Expert 2GB
Is a submacro something new in Access 2007? I can find no reference to it in v2003.

Welcome to Bytes!

Linq ;0)>
Dec 25 '08 #3
ADezii
8,834 Expert 8TB
@surferj
What you are attempting to do is to Run a specific Macro within a Macro Group, namely execute the ConsumerMoSalesR Macro within the M_Report2007 Group. Access 2007 still supports the concept of Macro Groups, but does the Group Macro still exist and is it named M_Report2007? Is the Macro within this Group still named ConsumerMoSalesR? Remove the Macro ConsumerMoSalesR from the Group, isolate it, and run it as an individual Macro, then see what happens.
Dec 25 '08 #4
surferj
11
@missinglinq
Sorry - Macro within a Macro Group
Dec 27 '08 #5
surferj
11
@ADezii
M_Report2007 still exists and named accordingly. Also ConsumerMoSalesR exists within the macro group. Macro functions normally in Access2003 but for some reason does execute in 2007
Dec 27 '08 #6
ADezii
8,834 Expert 8TB
@surferj
Then, convert the Macro to VBA Code, and you should have no problem. How about posting exactly what the Macro does, so that we may be able to look into the matter more deeply?
Dec 27 '08 #7
nico5038
3,080 Expert 2GB
Hmm, I see a duplication of comments <LOL>

Nic;o)
(But ofcourse interested in the code)
Dec 27 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: =?utf-8?b?QXNiasO4cm4gU8OmYsO4?= | last post by:
I am replacing a number of functions with macros. Some of these functions "do something" and then return a variable. This behaviour I have found that I can emulate using the comma operator: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.