CheckBox events not firing? 
Author Message
 CheckBox events not firing?

I'm using Sue's book to get reaquainted with VBA. (Sue - as long as you keep
writing them I'll keep buying them).

Using Outlook 2000 SR-1 CW and VBA 6.3 I've created a test form with a
checkbox and using MsgBox to track where the execution is at.

When I click into and out of the CheckBox message boxes for Click, Enter and
Exit are displaying, but CheckBox_AfterUpdate and CheckBox_BeforeUpdate
don't appear.

Also the Form Activate and DeActivate don't appear to be firing.

I haven't tried any other commands to track the execution.

I seem to recall that MsgBox, depending on the context it's use in, won't
always fire. Is that the case here?

Thanks



Wed, 05 May 2004 02:53:35 GMT  
 CheckBox events not firing?
This is a VBA form, not an Outlook form, right? Want to post your code --
that's the quickest way to get someone to try it out and help.

--
Sue Mosher, Outlook MVP
   Outlook and Exchange Solutions
   at http://www.slipstick.com


Quote:
> I'm using Sue's book to get reaquainted with VBA. (Sue - as long as you
keep
> writing them I'll keep buying them).

> Using Outlook 2000 SR-1 CW and VBA 6.3 I've created a test form with a
> checkbox and using MsgBox to track where the execution is at.

> When I click into and out of the CheckBox message boxes for Click, Enter
and
> Exit are displaying, but CheckBox_AfterUpdate and CheckBox_BeforeUpdate
> don't appear.

> Also the Form Activate and DeActivate don't appear to be firing.

> I haven't tried any other commands to track the execution.

> I seem to recall that MsgBox, depending on the context it's use in, won't
> always fire. Is that the case here?

> Thanks



Wed, 05 May 2004 03:41:56 GMT  
 CheckBox events not firing?
Yeah, it's a VBA form. The code is below.

I've done a little more testing. It looks like the MsgBox statement is
eating (at least sometimes, at least in the development environment) the
follow on operations.

The form consists of 3 controls. First a textbox, then a checkbox, then a
command button

When starting up the form I get the Form Initialize message, then the
TextBox Enter message. The Form Activate message does not appear. If I
comment out the TextBox Enter message, the Form Activate message appears.

When I click into the checkbox, the CheckBox Enter message appears, then the
CheckBox Click message, but the CheckBox remains unclicked (no check mark).
If I comment out the CheckBox Enter message I get the CheckBox Click message
and the box is checked.

<snip>

Private Sub UserForm_Activate()
    MsgBox "Form Activate"
End Sub

Private Sub UserForm_Click()
    MsgBox "Form Click"
End Sub

Private Sub UserForm_Deactivate()
    MsgBox "Form Deactivate"
End Sub

Private Sub UserForm_Initialize()
    MsgBox "Form Initialize"
End Sub

Private Sub UserForm_Terminate()
    MsgBox "Form Terminate"
End Sub

Private Sub TextBox1_AfterUpdate()
    MsgBox "TextBox After Update"
End Sub

Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
    MsgBox "TextBox Before Update"
End Sub

Private Sub TextBox1_Enter()
    MsgBox "TextBox Enter"
End Sub

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    MsgBox "TextBox Exit"
End Sub

Private Sub CheckBox1_AfterUpdate()
    MsgBox "CheckBox After Update"
End Sub

Private Sub CheckBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
    MsgBox "CheckBox Before Update"
End Sub

Private Sub CheckBox1_Click()
    MsgBox "CheckBox Click"
End Sub

Private Sub CheckBox1_Enter()
    MsgBox "CheckBox Enter"
End Sub

Private Sub CheckBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    MsgBox "CheckBox Exit"
End Sub

Private Sub CommandButton1_Click()
    MsgBox "Command Button Click"
End Sub

<snip>


Quote:
> This is a VBA form, not an Outlook form, right? Want to post your code --
> that's the quickest way to get someone to try it out and help.

> --
> Sue Mosher, Outlook MVP
>    Outlook and Exchange Solutions
>    at http://www.slipstick.com



> > I'm using Sue's book to get reaquainted with VBA. (Sue - as long as you
> keep
> > writing them I'll keep buying them).

> > Using Outlook 2000 SR-1 CW and VBA 6.3 I've created a test form with a
> > checkbox and using MsgBox to track where the execution is at.

> > When I click into and out of the CheckBox message boxes for Click, Enter
> and
> > Exit are displaying, but CheckBox_AfterUpdate and CheckBox_BeforeUpdate
> > don't appear.

> > Also the Form Activate and DeActivate don't appear to be firing.

> > I haven't tried any other commands to track the execution.

> > I seem to recall that MsgBox, depending on the context it's use in,
won't
> > always fire. Is that the case here?

> > Thanks



Thu, 06 May 2004 02:41:59 GMT  
 CheckBox events not firing?
Done a little more checking. Using the "debug.print <string>" statement in
place of the msgbox gives me what I want. This will print the string in the
immediate window and not eat any of the follow on operations.

thanks


Quote:
> Yeah, it's a VBA form. The code is below.

> I've done a little more testing. It looks like the MsgBox statement is
> eating (at least sometimes, at least in the development environment) the
> follow on operations.

> The form consists of 3 controls. First a textbox, then a checkbox, then a
> command button

> When starting up the form I get the Form Initialize message, then the
> TextBox Enter message. The Form Activate message does not appear. If I
> comment out the TextBox Enter message, the Form Activate message appears.

> When I click into the checkbox, the CheckBox Enter message appears, then
the
> CheckBox Click message, but the CheckBox remains unclicked (no check
mark).
> If I comment out the CheckBox Enter message I get the CheckBox Click
message
> and the box is checked.

> <snip>

> Private Sub UserForm_Activate()
>     MsgBox "Form Activate"
> End Sub

> Private Sub UserForm_Click()
>     MsgBox "Form Click"
> End Sub

> Private Sub UserForm_Deactivate()
>     MsgBox "Form Deactivate"
> End Sub

> Private Sub UserForm_Initialize()
>     MsgBox "Form Initialize"
> End Sub

> Private Sub UserForm_Terminate()
>     MsgBox "Form Terminate"
> End Sub

> Private Sub TextBox1_AfterUpdate()
>     MsgBox "TextBox After Update"
> End Sub

> Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
>     MsgBox "TextBox Before Update"
> End Sub

> Private Sub TextBox1_Enter()
>     MsgBox "TextBox Enter"
> End Sub

> Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
>     MsgBox "TextBox Exit"
> End Sub

> Private Sub CheckBox1_AfterUpdate()
>     MsgBox "CheckBox After Update"
> End Sub

> Private Sub CheckBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
>     MsgBox "CheckBox Before Update"
> End Sub

> Private Sub CheckBox1_Click()
>     MsgBox "CheckBox Click"
> End Sub

> Private Sub CheckBox1_Enter()
>     MsgBox "CheckBox Enter"
> End Sub

> Private Sub CheckBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
>     MsgBox "CheckBox Exit"
> End Sub

> Private Sub CommandButton1_Click()
>     MsgBox "Command Button Click"
> End Sub

> <snip>



> > This is a VBA form, not an Outlook form, right? Want to post your
code --
> > that's the quickest way to get someone to try it out and help.

> > --
> > Sue Mosher, Outlook MVP
> >    Outlook and Exchange Solutions
> >    at http://www.slipstick.com



> > > I'm using Sue's book to get reaquainted with VBA. (Sue - as long as
you
> > keep
> > > writing them I'll keep buying them).

> > > Using Outlook 2000 SR-1 CW and VBA 6.3 I've created a test form with a
> > > checkbox and using MsgBox to track where the execution is at.

> > > When I click into and out of the CheckBox message boxes for Click,
Enter
> > and
> > > Exit are displaying, but CheckBox_AfterUpdate and

CheckBox_BeforeUpdate

- Show quoted text -

Quote:
> > > don't appear.

> > > Also the Form Activate and DeActivate don't appear to be firing.

> > > I haven't tried any other commands to track the execution.

> > > I seem to recall that MsgBox, depending on the context it's use in,
> won't
> > > always fire. Is that the case here?

> > > Thanks



Thu, 06 May 2004 03:08:38 GMT  
 CheckBox events not firing?
MsgBox is application-modal, so all processing stops until the user clicks a
button. So Debug.Print definitely sounds like a better approach for you
here.


Quote:
> Done a little more checking. Using the "debug.print <string>" statement in
> place of the msgbox gives me what I want. This will print the string in
the
> immediate window and not eat any of the follow on operations.

> thanks



> > Yeah, it's a VBA form. The code is below.

> > I've done a little more testing. It looks like the MsgBox statement is
> > eating (at least sometimes, at least in the development environment) the
> > follow on operations.

> > The form consists of 3 controls. First a textbox, then a checkbox, then
a
> > command button

> > When starting up the form I get the Form Initialize message, then the
> > TextBox Enter message. The Form Activate message does not appear. If I
> > comment out the TextBox Enter message, the Form Activate message
appears.

> > When I click into the checkbox, the CheckBox Enter message appears, then
> the
> > CheckBox Click message, but the CheckBox remains unclicked (no check
> mark).
> > If I comment out the CheckBox Enter message I get the CheckBox Click
> message
> > and the box is checked.

> > <snip>

> > Private Sub UserForm_Activate()
> >     MsgBox "Form Activate"
> > End Sub

> > Private Sub UserForm_Click()
> >     MsgBox "Form Click"
> > End Sub

> > Private Sub UserForm_Deactivate()
> >     MsgBox "Form Deactivate"
> > End Sub

> > Private Sub UserForm_Initialize()
> >     MsgBox "Form Initialize"
> > End Sub

> > Private Sub UserForm_Terminate()
> >     MsgBox "Form Terminate"
> > End Sub

> > Private Sub TextBox1_AfterUpdate()
> >     MsgBox "TextBox After Update"
> > End Sub

> > Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
> >     MsgBox "TextBox Before Update"
> > End Sub

> > Private Sub TextBox1_Enter()
> >     MsgBox "TextBox Enter"
> > End Sub

> > Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
> >     MsgBox "TextBox Exit"
> > End Sub

> > Private Sub CheckBox1_AfterUpdate()
> >     MsgBox "CheckBox After Update"
> > End Sub

> > Private Sub CheckBox1_BeforeUpdate(ByVal Cancel As

MSForms.ReturnBoolean)

- Show quoted text -

Quote:
> >     MsgBox "CheckBox Before Update"
> > End Sub

> > Private Sub CheckBox1_Click()
> >     MsgBox "CheckBox Click"
> > End Sub

> > Private Sub CheckBox1_Enter()
> >     MsgBox "CheckBox Enter"
> > End Sub

> > Private Sub CheckBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
> >     MsgBox "CheckBox Exit"
> > End Sub

> > Private Sub CommandButton1_Click()
> >     MsgBox "Command Button Click"
> > End Sub

> > <snip>



> > > This is a VBA form, not an Outlook form, right? Want to post your
> code --
> > > that's the quickest way to get someone to try it out and help.

> > > --
> > > Sue Mosher, Outlook MVP
> > >    Outlook and Exchange Solutions
> > >    at http://www.slipstick.com



> > > > I'm using Sue's book to get reaquainted with VBA. (Sue - as long as
> you
> > > keep
> > > > writing them I'll keep buying them).

> > > > Using Outlook 2000 SR-1 CW and VBA 6.3 I've created a test form with
a
> > > > checkbox and using MsgBox to track where the execution is at.

> > > > When I click into and out of the CheckBox message boxes for Click,
> Enter
> > > and
> > > > Exit are displaying, but CheckBox_AfterUpdate and
> CheckBox_BeforeUpdate
> > > > don't appear.

> > > > Also the Form Activate and DeActivate don't appear to be firing.

> > > > I haven't tried any other commands to track the execution.

> > > > I seem to recall that MsgBox, depending on the context it's use in,
> > won't
> > > > always fire. Is that the case here?

> > > > Thanks



Thu, 06 May 2004 06:53:32 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. click event not firing if lost_focus is firing first

2. ReadProperties event and WriteProperties event are not firing

3. checkbox click event firing

4. Changing value of Checkbox or OptionButton without firing Click Event

5. Control Event Problem (Post Event after an event is fired)

6. Terminate Event not Fired

7. BeforeDelConfirm, AfterDelConfirm events not firing

8. Inspector_Close Event Not Firing

9. Outlook 2000 Add-in : Disconnect events do not fire

10. Event does not fire after showing a form

11. Form events not firing in public folder

12. Reply Inspector not firing terminate event???

 

 
Powered by phpBB® Forum Software