Missing events when declaring controls withevents in vba

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Stefan Poehn (stefan.poehn_at_IH8SPAMbms.de)
Date: 11/26/04


Date: Fri, 26 Nov 2004 16:03:03 +0100

Hi

I am drawing a textbox on a form in vba and choose the name "TextBox1". I
can catch the event Textbox1_Exit. When I declare a textbox "Private
WithEvents mtextbox as MSForms.TextBox" I do not have the Exit event. The
combobox for choosing the events from TextBox1 displays the event Exit. The
combobox for choosing the events from mtextbox does not display event Exit.
Even if I rename the TextBox1_Exit method to mtextbox_Exit the Exit event
does not get fired for mtextbox.

Is this a bug in VBA? Can I get around it?

Thanks
  Stefan
.



Relevant Pages

  • RE: Exit event/textbox/frame
    ... it continued on and executed the exit event for textbox1. ... Private Sub Frame1_Exit(ByVal Cancel As MSForms.ReturnBoolean) ... Private Sub TextBox1_Exit ... 'This is 1st textbox in Frame1 ...
    (microsoft.public.excel.programming)
  • Re: calling an _Exit event
    ... If the TextBox is on a sheet and you call from within the sheet code module ... If you then select another control in the same form, the Exit event ...
    (microsoft.public.excel.programming)
  • Re: How to Make Tabbing work from VBA
    ... Microsoft has made the decision to retire VBA because by design it cannot be ... > tab key properly generates an Exit event. ... > I implement the _Enter and _Exit methods of each textbox to display a debug ...
    (microsoft.public.mac.office.word)
  • Re: How To Get An Event To Run When I Exit A TextBox
    ... > If the textbox is in a userform, then use the Exit event. ... The first suggestion I made was the exit event (which ...
    (microsoft.public.excel.programming)
  • Re: problem with buggy textbox Exit event
    ... Private Sub SpinButton1_SpinDown ... However, if I use the following in the Exit event, the message box that is ... I have a textbox next to a spinner control, ...
    (microsoft.public.word.vba.userforms)