Is it possible to supply an argument for a macro?

prabha_friend

Prabhakaran Karuppaih
Local time
Today, 10:16
Joined
Mar 22, 2009
Messages
927
Is it possible to supply/receive an argument(parameters) for a macro?

Like we supply for the function procedures?

Scenario:
I am exporting many queries to a same path. So that, I can supply the repeated path as a parameter.

I think it was available on previous versions of Ms-Access.
 
Last edited:
Create a form and add a textbox name the textbox something like txtPath and then refer to the txtPath in your code and it will work.
 
You have several options:
  • Put this value in a hidden text box on your main form
  • Put this value in a text box on an hidden form
  • Put it into a table and read it using a function
  • Write this value to the registery and read it using a function
  • Use a public variable and read it using a function

If you want it to be saved over sessions I prefer writing it into the registery.

You can put the function in the macro, or maybe read it directly without the macro.
 
or use TempVars
 
macro can accept parameters!
 

Users who are viewing this thread

Back
Top Bottom