how to have form button run vba module

LDW

Registered User.
Local time
Today, 10:59
Joined
Dec 31, 2012
Messages
19
I created a VBA module called Module_1 and wanted to have my form button run this when clicked. I have a Command_11 button and went to On Click > Event Procedure > Code Builder.

What do I enter there? When I copy my VBA code in, that doesn't seem to work.

Any help is much appreciated!
 
Can you be more specific? I assume you have a function or procedure you're trying to run in the Click event of this button, but what is the code? What do you mean by it "doesn't seem to work"? Nothing happens at all? Something happens but not what you expect?
 
You don't run modules. You run procedures that are in modules and each procedure has to be called on its own, or be called from another procedure.

A procedure is either a Sub or Function.
 
Thanks for the clarification! I see what I did now.

I had it saying Private Sub and then Function (with my copied code), so obviously I only needed the Sub part. I deleted the unneeded code and it runs perfect. Thanks for pointing me in the right direction!
 

Users who are viewing this thread

Back
Top Bottom