Some events are available only in the container object of the
control. This applies especially to text boxes, and a RefEdit is
just a juiced up text box. You can use the Exit event in your
form module:
Private Sub RefEdit1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
MsgBox "exit "
End Sub
but the same will not work in a class module containing a
WithEvents RefEdit object.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"Mark Driscol" wrote in message
oups.com...
Chip, I see you are online today, can you shed any light on
this? Just
wondering if there is a way in advance to tell what Events
are/are not
available in a Class module before formulating a solution.
Any input would be appreciated.
Mark
Mark Driscol wrote:
Upon further researching this, it appears that the Exit event
doesn't
exist in the Class module for a RefEdit control, although the
Change
event does exist. Can anyone explain to me why the Exit event
doesn't
exist? Without its existence, I suppose I am left to using
the
original code in the UserForm?
Thanks.
Mark
Mark Driscol wrote:
Excel 2002, Windows XP Version 2002, SP1
I have a RefEdit control on a UserForm that has both Change
and Exit
events working without a problem. I subsequently defined a
Class
module that would contain a RefEdit control and moved the
UserForm's
code to the Class module. In the Class module, the Change
event code
works without a problem, but the Exit event's code will not
work. Even
something as simple as the code below won't work. Any ideas
on why
not? One would think that if the Change event code worked,
they Exit
event code would work as well.
Public WithEvents RefEdit As RefEdit.RefEdit
Private Sub RefEdit_Exit(ByVal Cancel As
MSForms.ReturnBoolean)
MsgBox "Hello"
End Sub
Thanks in advance.
Mark