Solved

vba  to call a macro in access 2003

Posted on 2013-11-22
6
531 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 50

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

808 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