P perico Sep 29, 2003 #1 If I have a command button on form "A", is it possible to execute that command in code from form "B"? Is so, how?
If I have a command button on form "A", is it possible to execute that command in code from form "B"? Is so, how?
P Pavel Romashkin Sep 29, 2003 #2 The simplest is to copy the code in a public procedure and call the procedure from form A and B as necessary. If you insist on using the event code for the button, I'd like to hear why before going into how to do it. Cheers, Pavel
The simplest is to copy the code in a public procedure and call the procedure from form A and B as necessary. If you insist on using the event code for the button, I'd like to hear why before going into how to do it. Cheers, Pavel
A Allen Browne Sep 30, 2003 #3 Remove the "Private" keyword from the declaration of the procecure, e.g.: Private Sub MyButton_Click() You can now call it like this: Form_A.MyButton_Click Note that "Form_A" is the name of the module for a form named "A".
Remove the "Private" keyword from the declaration of the procecure, e.g.: Private Sub MyButton_Click() You can now call it like this: Form_A.MyButton_Click Note that "Form_A" is the name of the module for a form named "A".