Solved

RunCode from a macro

Posted on 2013-02-05
2
586 Views
Last Modified: 2013-02-05
I would like to use the RunCode option in an Access macro. The code itself requires 2 parameters, the name of the report, and some text. If I were to run it in VBA it would be called by:
store_PDF Me, Me.file_location

But I want to run it from a macro - how can I do it please?
0
Comment
Question by:rick_danger
2 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 38856069
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 38856112
First, the code your calling needs to be a function, not a sub.

Second, if your passing something other then a literal value:

=store_PDF("myForm","C:\mypdf.pdf")

 then your going to need to call other functions for the arguments to get the values:

=store_PDF(GetCurrentForm(),GetFileLocation())

Jim.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

932 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

10 Experts available now in Live!

Get 1:1 Help Now