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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trigger other form's events

Status
Not open for further replies.

illuzioner

Technical User
Dec 15, 2002
44
US
Hi,

Is it possible to trigger events on other forms (other than open the form)?

I have 2 forms that are already open, and when the user presses a button on one form I need to jump to another form and do some stuff. I was able to change the value of a toggle button on another form, but changing it didn't trigger it's onclick event.

I'd like it to behave just as though I clicked the button on that particular form instead of another one. Any ideas?

Thanks!

Lou
 
Lou,

You can indeed call the events on another form, but I usually find it makes more sense to go about it this way:
-Move all of the code that's in the click event of your button to a function in a standard module.
-In the click event of your button, call that function.
-In any other event you want, call that function.

Jeremy =============
Jeremy Wallace
AlphaBet City Dataworks

Take a look at the Developers' section of the site for some helpful fundamentals.
 
Thank you Jeremy,

How do I actually call another form's events?

I tried doing a call to its name after changing its declaration from Private to Public, but it still wasn't recognized.

I'd like to try this way before I start moving tons of code and changing everything to refer to the proper form.

Thanks again.

Lou

 
Okay, I think I figured it out. I use the full form declaration on the sub call too.

Thanks again for the help.

Lou
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top