Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Linked Textbox Controls on Form - Avoiding Cascading Change Events

Steve,
EnableEvents does not function in UserForms.
You can use a boolean flag to the same end however.
Declare a private variable at the top of the form module..

Private blnEnable As Boolean

In the Box1_Change code...
Box1_Change
blnEnable = True
Box2.value = ........
Box3.value = ........
blnEnable = False
End Sub

At the start of the Box2 and Box3 change code...
If blnEnable then Exit Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware




"Blue Aardvark"

wrote in message
Hello
I have 3 textboxes on a form. I want to allow the user to change one of them
and for the other 2 to automatically update. My code looks something like
this:

Box1_Change
Box2.value = ........
Box3.value = ........
end

However, when I set the values on the other boxes I start their Change
methods and I end up in an infinite loop. I have tried an
"Application.EnableEvents = False" to avoid this but it didn't work. Any
ideas on how to avoid this situation?
Thanks,
Steve
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
Events on controls generated on the fly... ste Excel Programming 1 September 1st 06 07:41 PM
Browse Forms Controls and change TextBox color based on cell color StefanW Excel Programming 2 November 21st 04 07:06 PM
Change events and linked cells Don Wiss Excel Programming 1 July 2nd 04 10:15 PM
Add Controls With Events at Runtime llowwelll Excel Programming 10 May 24th 04 11:52 AM
Events for Controls in a Multipage Control George[_18_] Excel Programming 4 February 18th 04 05:56 PM


All times are GMT +1. The time now is 07:29 AM.

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

About Us

"It's about Microsoft Excel"