+ Reply to Thread
Results 1 to 4 of 4

Suppressing events

  1. #1
    rci
    Guest

    Suppressing events

    Hi all...


    I am changing the value of a checkbox in code... and I need to suppress the
    click event when doing so. How might I do this?

    In other words, changing the value of a checkbox triggers the .click event,
    and I need to prevent this...

    Thanks!

    M

  2. #2
    ben
    Guest

    RE: Suppressing events

    application.enableevents = false

    BIG NOTE be very sure to reenable events with application.enableevents =
    true or else events will not function AT ALL.

    "rci" wrote:

    > Hi all...
    >
    >
    > I am changing the value of a checkbox in code... and I need to suppress the
    > click event when doing so. How might I do this?
    >
    > In other words, changing the value of a checkbox triggers the .click event,
    > and I need to prevent this...
    >
    > Thanks!
    >
    > M
    >


  3. #3
    Tom Ogilvy
    Guest

    Re: Suppressing events

    Application.EnableEvents only works on Excel events, not on the events
    associated with msforms control - a completely different library.

    --
    Regards,
    Tom Ogilvy

    "ben" <[email protected]> wrote in message
    news:[email protected]...
    > application.enableevents = false
    >
    > BIG NOTE be very sure to reenable events with application.enableevents =
    > true or else events will not function AT ALL.
    >
    > "rci" wrote:
    >
    > > Hi all...
    > >
    > >
    > > I am changing the value of a checkbox in code... and I need to suppress

    the
    > > click event when doing so. How might I do this?
    > >
    > > In other words, changing the value of a checkbox triggers the .click

    event,
    > > and I need to prevent this...
    > >
    > > Thanks!
    > >
    > > M
    > >




  4. #4
    Tom Ogilvy
    Guest

    Re: Suppressing events

    One technique is to declare a public variable at the top of a general module

    Public bBlockEvents as Boolean

    then in the click event of the control

    Private Sub Checkbox1_Click()
    if bBlockEvents then exit sub
    ' you current code
    End Sub

    Then in the code that would trigger the event

    bBlockEvents = True
    ' code that would trigger the event
    bBlockEvents = False

    so anytime you want to block events, set the flag (bBlockEvents) to true

    Every event procedure (that you want to be able to block) must check the
    value of the flag as the first thing and exit if it is true.


    --
    Regards,
    Tom Ogilvy


    "rci" <[email protected]> wrote in message
    news:[email protected]...
    > Hi all...
    >
    >
    > I am changing the value of a checkbox in code... and I need to suppress

    the
    > click event when doing so. How might I do this?
    >
    > In other words, changing the value of a checkbox triggers the .click

    event,
    > and I need to prevent this...
    >
    > Thanks!
    >
    > M




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1