Assign Module to Command Button

A

Andibevan

Hi All,

Can someone tell me how I assign a module to a command button?

Thanks

Andy
 
D

Douglas J Steele

And you do that through the properties associated with the Command Button.

If you have a function that you want run when the command button is clicked,
for instance, you would put the name of the function (complete with
parentheses), with an equal sign in front, in the box on the property sheet
beside On Click.

More common, though, is to set that property to [Event Procedure] (select it
from the combo box) and then click on the ellipsis (...) to the right. That
will take you into the VB Editor, into the Event Procedure associated with
the Click event of the button.
 
A

Andibevan

Sorry - I mean how do I assign a subroutine contained within a module to a
command button?
 
A

Andibevan

Thanks Doug - sometimes trying to find information on the really easy things
can be harder than finding info on more in-depth items.

Please ignore the mail I sent before I received your reply.

Douglas J Steele said:
And you do that through the properties associated with the Command Button.

If you have a function that you want run when the command button is clicked,
for instance, you would put the name of the function (complete with
parentheses), with an equal sign in front, in the box on the property sheet
beside On Click.

More common, though, is to set that property to [Event Procedure] (select it
from the combo box) and then click on the ellipsis (...) to the right. That
will take you into the VB Editor, into the Event Procedure associated with
the Click event of the button.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Dean said:
You don't assign modules, you assign a function or subroutine within a
module.
 
Top