Solved

vba  to call a macro in access 2003

Posted on 2013-11-22
6
512 Views
Last Modified: 2013-11-22
Hi expert's

I have a macro in ms access 2003 that works fine ...also have a second macro......what I want to do is call the second macro from the first macro..

Second macron is private sub cmdrunme ()
0
Comment
Question by:route217
6 Comments
 
LVL 25

Assisted Solution

by:-MAS
-MAS earned 166 total points
ID: 39668709
Write the below command in your first macro
"Call cmdrunme"
0
 
LVL 49

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 167 total points
ID: 39668717
Hi,

If not in  the same module it shouldn't be private

pls try

Sub YourMacro1
'Your code
Call cmdrunme()

'Your code
End Sub

Open in new window

Regards
0
 
LVL 14

Accepted Solution

by:
Bill Ross earned 167 total points
ID: 39668719
Hi,

In the macro use the RunCode option with cmdrunme ()

You will need to change the sub to a function and to public.

Private Sub cmdrunme()

s/b

Public Function cmdrunme()

Macros run functions not subs.

Private means they can't find them from a Macro which runs Public.

Regards,

Bill
0
 

Author Comment

by:route217
ID: 39669026
Apologies experts I meant to split the points can we open the question up
0
 

Author Closing Comment

by:route217
ID: 39669159
Thank you experts for re opening question and apologies on my part.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now