Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call an event procedure from other procedure 1

Status
Not open for further replies.

TTThio

Programmer
May 3, 2001
185
US
Hi guys,

does anybody know how we can call an event procedure from within another procedure.
For example,
If..... Then Call cmdOpen_Click

I've tried to apply it like calling regular routine but it didn't work. Any idea?

Thanks ahead,
Tin Tin
 
Hi!

It should work fine as long as you are calling it from code in the same form. I have used event procedure calls like that before. It is probably more acceptable practice to put the code in a separate procedure and call that procedure from both places.

hth
Jeff Bridgham
 
Thanks Jeff,

unfortunately, my sub routine is in the general module, and through that sub I'd like to evoke the form's event procedure.
If I move my sub routine to the form module, then I still have to call the sub through another form event procedure.
It's just to complicated to be applied for this time.

Thanks again though for the information.

Tin Tin

 
Tin Tin,

maybe this will help.

First make the event procedure you want to call public (replace the word Private with Public).

Then in your general module write:

dim x as New Form_YourFormName
x.cmdOpen_Click

Hope it helps
 
Hei, it really works that way.
Thanks a lot for still following up my issue.

TT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top