How to raise event between ocx's

Posted on 2006-06-06
Last Modified: 2011-09-20
Can someone show me how to fire an event in one ocx and catch in the other ocx?  

I have a 'Save' button in an ocx.  when the user clicks it.....I need the other ocx to re-query my database.   Can someone please show me how to do this??

Question by:JohnnyKnoxville
    LVL 26

    Accepted Solution

    if two ocx is one one form, then you can fire event from the first ocx and catch the event
    from the form, then call the method on the second ocx to perform the re-query database.

    Do you make both ocx?

    Author Comment

    Yes....I have made both OCX's.  Can you show me some specifics on how to do this???

    thx for the quick response.

    LVL 26

    Expert Comment

    you can do raiseevent in the first ocx

    in you form you should be able to trap this event. From this event, call the second ocx's method ( you need to use public on this method)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now