Calling an event on another form

  • Thread starter Thread starter arm
  • Start date Start date
Remove the Private keyword, and call the event procedure like this:
Call Form_Form1.cmdCancel_Click

That's calling the On Click event procedure for a button named cmdCancel on
Form1.
 
Don't forget that an instance of the Form must be open (though it may
be hidden or minimised) for you to be able to access a Control or
Public Function on it.

Remove the Private keyword, and call the event procedure like this:
Call Form_Form1.cmdCancel_Click

That's calling the On Click event procedure for a button named cmdCancel on
Form1.


Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 
Rather than having a Sub on a Form and calling this Sub
from another Form, it would be better to created a
Function inside a module then Call the module from both
Forms. When you call a Module in this manner you do not
need an instance of the original Form to be open.

Tony C.
 
Back
Top