How can I expose BeforeUpdate events to my TextBox class?

bereid

New Member
Joined
Dec 1, 2005
Messages
4
After defining a new TextBox class with a statement like the following:

Public WithEvents tbox As MSForms.TextBox

I can select the tbox class from the object drop-down list in VBE, BUT
the BeforeUpdate event is not available in the procedure drop-down.
Many of the other TextBox events (Change, for example) are available,
but I would like to handle the BeforeUpdate event.

Can anyone help me figure out what do do to make the missing event(s)
available to my class?

Thanks VERY much for any help,
Bruce Reid
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Bruce

I'm sorry but just don't think it's possible.:)

What exactly are you trying to do?
 
Upvote 0
Hi Norie,

I have a collection of TextBoxes (28 of them), and as the user moves from box to box, entering values into each, I want to validate the input, and give immediate feedback if an illegal value is entered. I'm currently monitoring the Change event, and that works fine for characters typed. But if a box whose contents have been deleted (legal value, so long as the box isn't empty on loss of focus) loses focus, I want to be able to immediately complain that an empty value is illegal. I don't want separate event handlers for each TextBox, but none of the events available to my class seem to do the job.

Thank you for considering my dilemma. I'll look forward to hearing if you have any ideas that I can apply to solve this problem.

Regards,
Bruce
 
Upvote 0

Forum statistics

Threads
1,203,396
Messages
6,055,157
Members
444,766
Latest member
bryandaniel5

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top