Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default Grouping Event handlers

Hmmm. Maybe I should be blaming Onedaywhen for interrupting my blissful
ignorance.

DK

"Dave Peterson" wrote in message
...
But the problem is you never know unless someone warns you (just in time,

whew!)
or you see it in a different thread (too late, grrrrr!).

Dick Kusleika wrote:

OK, that's it. I'm done answering old posts. At least I got it right.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"onedaywhen" wrote in message
om...
Dick,
Multiposts, don't you just love 'em:



http://groups.google.com/groups?selm...g .google.com

--

"Dick Kusleika" wrote in

message
...
Ripan



Dim req As RequiredField

Set req = New RequiredField
Set req.Required = frmDataEntry.txtClaimantName


The problem is that the variable req falls out of scope when this

procedure
ends and the class is un-instantiated (is that even a word?)

Dim req at the top of whatever module sets it so that it persists

beyond
the
scope of that procedure. For instance, if you wanted to instantiate

the
class in your Userform_Initialize event, the module would look like

this:

Option Explicit

Dim req As RequiredField

Private Sub UserForm_Initialize()

Set req = New RequiredField
Set req.Required = frmDataEntry.txtClaimantName

End Sub

Having req as a module level variable will hold the class and it

will
work
as you expect.


--

Dave Peterson



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
VBA Event Steve Excel Discussion (Misc queries) 2 October 14th 08 11:04 PM
Problems with event handlers Italian Job Excel Programming 2 November 12th 03 01:26 AM
Do Event John Gittins Excel Programming 1 October 22nd 03 04:58 PM
change event/after update event?? scrabtree23[_2_] Excel Programming 1 October 20th 03 07:09 PM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


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