Create public function to run code in Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have written code in a module. I am trying to create a macro that will run
this code by using Runcode action. However, access won't allow me to select
the function name. From previous posts, I learned that it must be a public
function. How do I create a "public" function?
 
Public Sub MyCode()

or

Public Function MyCode(strArg as Argument) As String

Private is the alternative to Public and is the default if omitted.
 
Actually, Public is the default, George.

It should be pointed out that the sub or function should be in a module, not
in the class associated with a form.
 
Back
Top