ReturnBoolean???

C

Charlotte E.

Hi,


I have a UserForm with one of the TextBoxes having the 'Exit' event to it...

TextBox_01_Exit(ByVal Cancel As MSForms.ReturnBoolean)

This works fine - no problem here :)

But, from another macro in the UserForm, I want to call this macro to
avoid double-coding, since the very same code should be run in the other
macro.

So, I try...

Call TextBox_01_Exit
Call TextBox_01_Exit(True)
Call TextBox_01_Exit(False)

....but none of these works?!?

How do I call the 'Exit' event from another macro???


Thanks in advance,

CE
 
A

Auric__

Charlotte said:
I have a UserForm with one of the TextBoxes having the 'Exit' event to
it...

TextBox_01_Exit(ByVal Cancel As MSForms.ReturnBoolean)

This works fine - no problem here :)

But, from another macro in the UserForm, I want to call this macro to
avoid double-coding, since the very same code should be run in the other
macro.

So, I try...

Call TextBox_01_Exit
Call TextBox_01_Exit(True)
Call TextBox_01_Exit(False)

...but none of these works?!?

How do I call the 'Exit' event from another macro???

Like this, in the calling function:
Dim x As MSForms.ReturnBoolean
TextBox_01_Exit x

If Cancel is set to True *in the Exit event*, then the control keeps the
focus.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top