LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Triggering Change_Events after Form Initialization

Hi.

I have a form whose controls are created and populated at runtime. I also
have two class modules, each of which handles a change_event for a particular
control. I received the Runtime Error 91: Variable or With block variable
not set. Having read several posts supressing form-level events, I created a
module-level, public Boolean variable in order to turn change_events on and
off. This has resolved the Runtime error, and all controls are now created
and populated. At this point, changing a combobox value should trigger its
change_event. However, even though I've turned the events back on at the end
of the module, nothing happens. Below is relevant code:

<module level
Public ChangePrice as Boolean
Sub Edit()
ChangePrice = False 'disables change_events
<Form initialized, controls created and populated.
ChangePrice = True 'enables change_events

<class module
Sub ctrl1_Change()
If ChangePrice = True then
cls(1).ctrl1.value = something
Else
Exit Sub
End If
End Sub

Why doesn't the change_event fire after I enable it?

TIA,

Jim
 
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
UserForm Initialization Patrick Simonds Excel Programming 1 January 21st 05 02:40 AM
Userform Initialization Patrick Simonds Excel Programming 2 May 22nd 04 10:17 PM
ShowDataForm Initialization Alan Excel Programming 2 February 11th 04 11:24 PM
User Form Initialization Josh[_7_] Excel Programming 1 November 5th 03 07:35 PM
List box initialization Tom Ogilvy Excel Programming 0 July 15th 03 05:41 PM


All times are GMT +1. The time now is 08:17 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"