Call a Cmd Button

L

Lamar

I want to use a marco to call/run a Sub statement from a form. The marco
opens the form and then I want it call/run following Sub statement from a cmd
button.

cmdImportData_Click

Thanks for any help.
 
S

Steve Schapel

Lamar,

As far as I know, this is not possible, exactly as you stated. I think
your choices are:
1. Whatever the code in the cmdImportData_Click procedure, do the
equivalent thing in the macro using standard macro actions.
2. Change the cmdImportData_Click subprocedure to a Public Function,
and then use the RunCode action in the macro.
3. Do the whole thing in VBA, instead of the macro, using the OpenForm
method, and then the Call method in VBA to run the subprocedure.
 

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