Originally Posted by
Soule
Hi, Everyone,
I want to click a form button and run code in a STANDARD module (not the "behind the form" class module).
Can I enter the name of that Public Sub in the On Click Property box?
Pointing a button to code doesn't always have to be done with the "Event Procedure" option filled in the On Click Property box, correct?
I have a Public Sub in a standard module that my form button doesn't seem to see, even though the name of the button and the Sub are different.
Any bit of information to clear this up for me will be appreciated. Thanks.
Frank
This post is also here
http://www.utteraccess.com/forum/Ent...-t1983327.html
and here
http://www.access-programmers.co.uk/...d.php?t=222613
Answered in the other posts, so I'll give a different option.
You CAN call a sub in a standard module, but you have to use an Event procedure.
Set the "On Click" property of the button to [Event Procedure] ; the code would look like:
Code:
Private Sub cmdYourButtonName_Click()
Call SetBase
End Sub
where "SetBase" is the name of your sub in the standard module.