Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

RunCode from a macro

Posted on 2013-02-05
2
Medium Priority
?
645 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 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

877 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