Solved

RunCode from a macro

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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.

762 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

18 Experts available now in Live!

Get 1:1 Help Now