vba  to call a macro in access 2003

Posted on 2013-11-22
Medium Priority
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 ()
Question by:route217
LVL 29

Assisted Solution

by:MAS (MVE)
MAS (MVE) earned 664 total points
ID: 39668709
Write the below command in your first macro
"Call cmdrunme"
LVL 54

Assisted Solution

Rgonzo1971 earned 668 total points
ID: 39668717

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

LVL 14

Accepted Solution

Bill Ross earned 668 total points
ID: 39668719

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()


Public Function cmdrunme()

Macros run functions not subs.

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



Author Comment

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

Author Closing Comment

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

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…

624 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