Running a VB code from Macro

G

Guest

I have created a module a sub procedure [ SelectFieldOrder() ]. I have
created a a macro with an action of RunCode and Function Name as
SelectFieldOrder(). When I run the Macro I get "The expression you entered
has a function neame that Microsoft Access can't find", and the Action
failed.
 
G

Guest

Hi.
I have created a module a sub procedure [ SelectFieldOrder() ]. I have
created a a macro with an action of RunCode and Function Name as
SelectFieldOrder().

Note that RunCode must call a function, not a sub procedure. If you want to
call a sub procedure instead of a function from the macro, then create a
function that calls the sub procedure, then type this function name in the
Function Name text box.

Make sure that the SelectFieldOrder( ) procedure is a public, not private,
function in a standard module, not a class module. If it is defined in a
form module or report module, then make sure that the macro is only called
from this particular form or report or from a menu. Also, make sure that the
name of the module where this procedure is defined is not named the same as
any procedure within the module, including "SelectFieldOrder." Ensure that
the open and close parentheses are included after the function name when you
type it into the macro's Function Name text box.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts, so that all
may benefit by filtering on "Answered questions" and quickly finding the
right answers to similar questions. Remember that the best answers are often
given to those who have a history of rewarding the contributors who have
taken the time to answer questions correctly.


Canute said:
I have created a module a sub procedure [ SelectFieldOrder() ]. I have
created a a macro with an action of RunCode and Function Name as
SelectFieldOrder(). When I run the Macro I get "The expression you entered
has a function neame that Microsoft Access can't find", and the Action
failed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top