Solved

vba  to call a macro in access 2003

Posted on 2013-11-22
6
500 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 24

Assisted Solution

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

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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Suggested Solutions

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

744 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

11 Experts available now in Live!

Get 1:1 Help Now