Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel CheckBox on UserForm Event Loops

Hi,

I have created an Excel UserForm with multiple checkboxes. I am noticing
some strange behavior in that this control keeps firing the Click / Change
Event every time I change the controls.value property - enn in other code.

I did notice a support article stating this on MSDN after much pulling hair.

I am wondering if anyone out there has had this happen and am wondering how
you got around it. Currently, I have public variables set to bypass the event
code, but I would think there is a better way.

Example:
sub chkbox1.Change()
Set_Control()
end

sub chkbox2.Change()
Set_Control()
end
....

sub Set_Control
Use tabindex to also set values for other check boxes in different frames.
other.value = True (or false)
end sub

I notice that the change event fires again after set control which then
initiates Set Control again. It doesn't cause an endless loop but fires
routine twice.

Anyone have any ideas?
A relatively simple userform has taken days to get the controls to work
right because of this issue.

Thanks
--
ptnagle
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel CheckBox on UserForm Event Loops

Vraiables is the standard way

sub chkbox1.Change()
Static FControl As Boolean
If Not fBoolean Then
fBoolean = True
Set_Control
fBoolean = False
End If
End Sub



--

HTH

RP
(remove nothere from the email address if mailing direct)


"ptnagle" wrote in message
...
Hi,

I have created an Excel UserForm with multiple checkboxes. I am noticing
some strange behavior in that this control keeps firing the Click / Change
Event every time I change the controls.value property - enn in other code.

I did notice a support article stating this on MSDN after much pulling

hair.

I am wondering if anyone out there has had this happen and am wondering

how
you got around it. Currently, I have public variables set to bypass the

event
code, but I would think there is a better way.

Example:
sub chkbox1.Change()
Set_Control()
end

sub chkbox2.Change()
Set_Control()
end
...

sub Set_Control
Use tabindex to also set values for other check boxes in different frames.
other.value = True (or false)
end sub

I notice that the change event fires again after set control which then
initiates Set Control again. It doesn't cause an endless loop but fires
routine twice.

Anyone have any ideas?
A relatively simple userform has taken days to get the controls to work
right because of this issue.

Thanks
--
ptnagle



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkbox Event BHatMJ Excel Discussion (Misc queries) 2 May 16th 08 06:14 PM
Click Checkbox Event Montana DOJ Help Desk Excel Programming 4 November 11th 04 04:25 AM
Change Event that Loops ExcelMonkey[_120_] Excel Programming 6 May 14th 04 11:14 PM
Excel VBA - Userform Checkbox/Textbox Problem Thunder5 Excel Programming 1 February 16th 04 02:06 PM
CheckBox Event devin Excel Programming 2 January 29th 04 05:59 PM


All times are GMT +1. The time now is 03:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"