How can I call an [Event Procedure] of a Button in another form ?
I have frm1
with on Button: btn1
this btn1 has one event OnClick
the code is
Private Sub btn1_Click()
Now I have to call this btn1 from another form: frm2
The call should check if there is an [Event Procedure]
and if so Call it
Something like this (This code is on frm2)
dim frm as form, ctl as control
set ctl = frm("btn1") 'I need it this way because I don't know the name of the buttons, the real code will loop on all the controls on frm1
if ctl.OnClick > "" then
msgbox("We Have Event")
'How can I run the event ?????
'Call btn1[Event Procedure] ???????
msgbox("We Don't Have Event")