Group: microsoft.public.word.vba.general
From: =?Utf-8?B?SmVhbi1HdXkgTWFyY2ls?=
Date: Friday, February 22, 2008 2:59 PM
Subject: RE: Disabling click and change events in form initialize

"Peter" wrote:

> Hi,
> As with all user forms, if you set the value or state of a control in the
> initialize macro, then the corresponding _click or _change event macro will
> fire. I am looking for a way to disable this. I want to set the state and
> values of controls without firing these macros until after the initialize
> macro is done and the form is displayed. Is there a way to do this?

One way around that is to create a global Boolean variable in the user form
module. Set it to false at the beginning of the Initialize event. Then, in
all Click-Change- etc. events put all code in an "IF Not Boolean Then Exit"
type of structure. At the end of the Initialze event, set the Boolean to True.

There maybe a more official-elegant way of doing this, but I have always
used that without any problems.