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: - Private Sub Cancel_Click()
-
DoCmd.Close
-
End Sub
- Private Sub Form_Open(Cancel As Integer)
-
'If Not bInReportOpenEvent Then
-
' If we're not called from the report
-
'MsgBox "For use from the Sales Goals Report only", vbOKOnly
-
'Cancel = True
-
'End If
-
'Form_Open_Exit:
-
'Exit Sub
-
End Sub
- Private Sub OK_Click()
-
If (Eval("[Forms]![F_Sales_Month DialogC].[CMonthC] Is Null")) Then
-
' is MISSING !
-
Beep
-
MsgBox "Current Month Value is MISSING ! Please Enter...........", vbOKOnly, ""
-
Exit Sub
-
End If
-
If (Eval("[Forms]![F_Sales_Month DialogC].[NMonthC] Is Null")) Then
-
' is MISSING !
-
Beep
-
MsgBox "Next Month Value is MISSING ! Please Enter...........", vbOKOnly, ""
-
Exit Sub
-
End If
-
-
Me.Visible = False
-
DoCmd.RunMacro "M_Report2007.ConsumerMoSalesR", 1
-
End Sub
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)
Is a submacro something new in Access 2007? I can find no reference to it in v2003.
Welcome to Bytes!
Linq ;0)> 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.
@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
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?
nico5038 3,080
Recognized Expert Specialist
Hmm, I see a duplication of comments <LOL>
Nic;o)
(But ofcourse interested in the code)
Sign in to post your reply or Sign up for a free account.
Similar topics |
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:
|
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...
|
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...
|
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...
|
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...
| |
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| | |