Is it possible to supply an argument for a macro? (1 Viewer)

prabha_friend

Prabhakaran Karuppaih
Local time
Tomorrow, 00:35
Joined
Mar 22, 2009
Messages
783
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:

Trevor G

Registered User.
Local time
Today, 20:05
Joined
Oct 1, 2009
Messages
2,341
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.
 

smig

Registered User.
Local time
Today, 22:05
Joined
Nov 25, 2009
Messages
2,209
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.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:05
Joined
May 7, 2009
Messages
19,230
or use TempVars
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:05
Joined
May 7, 2009
Messages
19,230
macro can accept parameters!
 

Users who are viewing this thread

Top Bottom