View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
drhalter drhalter is offline
external usenet poster
 
Posts: 39
Default suspend processing for TextBox_Change events when initializing a f

I have a form with multiple textboxes. When initializing the form, I use
values from the worksheet to fill the textboxes. Each of these
initialization steps triggers the TextBox_Change event, which is unnecessary
during the initialization. Can I easily stop the TextBox_Change event during
this initialization?

The code following works, but seems a little bulky and I would prefer
something more efficient or eloquent. Oh, and it's a pain to have to write
the TextBox_Change code over and over for multiple textboxes.

What I have done is this (with x being a public variable):
x = false
....code that triggers Textbox_Change
x=true

Textbox_Change
If x = true then
....code
Else
'do nothing
End If

Thanks,
drhalter