Attach an existing VBA sub to a new button

JimL

Registered User.
Local time
Yesterday, 20:15
Joined
Jul 9, 2019
Messages
20
I have looked at various searches on this but have not been able to determine how to create a button and then associate it with an existing VBA sub.
`
Can anyone help, please?

Thanks
 
If the function/sub is in a standard module, you just call it by name:

http://www.baldyweb.com/Function.htm

If it's an existing event procedure (which I personally wouldn't do), you have to make it public and then call it like

Forms!FormName.Command3_Click
 
Hi. If you have a certain procedure that needs to be executed from multiple events or scenarios, you might consider moving it to a Public Sub or Function.
 

Users who are viewing this thread

Back
Top Bottom