473,809 Members | 2,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

11 New Member
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.C onsumerMoSalesR " , 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 9084
nico5038
3,080 Recognized Expert Specialist
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 Recognized Expert Specialist
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 Recognized Expert Expert
@surferj
What you are attempting to do is to Run a specific Macro within a Macro Group, namely execute the ConsumerMoSales R 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 ConsumerMoSales R? Remove the Macro ConsumerMoSales R from the Group, isolate it, and run it as an individual Macro, then see what happens.
Dec 25 '08 #4
surferj
11 New Member
@missinglinq
Sorry - Macro within a Macro Group
Dec 27 '08 #5
surferj
11 New Member
@ADezii
M_Report2007 still exists and named accordingly. Also ConsumerMoSales R 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 Recognized Expert Expert
@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 Recognized Expert Specialist
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
2007
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: #define MYMACRO (do_something(), file_scope_variable - get_a_value() ) Other functions need local storage (but do not return a value), and can be emulated using a block (a compund statement) to provide a scope for a variable:
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10635
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10115
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7653
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.