Solved

RunCode from a macro

Posted on 2013-02-05
2
598 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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

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

Suggested Solutions

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

777 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