Re: Control Exit event kills Button Click Event in Access2002 Form

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Dirk Goldgar (dg_at_NOdataSPAMgnostics.com)
Date: 10/20/04


Date: Wed, 20 Oct 2004 12:08:50 -0400


"Mike Elliott" <Mike Elliott@discussions.microsoft.com> wrote in
message news:D1B77F35-2113-4C28-94EB-390083A1F609@microsoft.com
> I left out an important detail. The Exit procedure determines which
> field to move to next. The DoCmd.GotoControl statement in the Exit
> procedure moves the focus to a third control.
>
> This causes a problem because users have to Click the button multiple
> times. Each click fires the "Exit" Event for whichever control has
> the focus. When they get to a control with no Exit event, then the
> Click event for the button will fire.

That makes sense. The focus has to get to the button before it can
receive the mouse click, and you're preventing it from getting there.

If you need to find a way to work around this, I'd guess you need to
move the focus-shifting code out of the Exit event of that control, and
put it either in the button itself (if that makes sense in the context
of what you're trying to do), or in the GotFocus or Enter event of a
control that you place next in the tab order. But the specifics will
depend on what you're trying to do.

Good luck.

-- 
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)


Relevant Pages

  • Re: Cancel buttons ActiveControl reflects as value of text box
    ... cannot use a Cancel button on your form to achieve what you want to. ... Remove the code from the text box's Exit event. ... BeforeUpdate event of the *form* (not control.) That's actually the only way ...
    (microsoft.public.access.formscoding)
  • Re: EXIT EVENT doesnt fire until I exit the form. Hhouldnt it fire on exit of control?
    ... Shouldn't it fire when I click on another ... If I set up an AfterUpdate event for the same control, ... Am I mis-interpreting how the exit event works? ... There is no exit event in VB6, ...
    (microsoft.public.vb.controls)
  • Re: Control Exit event kills Button Click Event in Access2002 Form
    ... The DoCmd.GotoControl statement in the Exit procedure moves ... Each click fires the "Exit" Event for whichever control has the focus. ... will fire. ...
    (microsoft.public.access.formscoding)
  • Re: change null to a value of 0
    ... I'd like to have the value return to 0 either in the event they exit the ... control without typing in a value. ... the On Exit Event of that control, but I am not sure what code would ...
    (microsoft.public.access.formscoding)
  • change null to a value of 0
    ... I have a control on a form with a default value of "0" that users have ... I'd like to have the value return to 0 either in the event they exit the ... the On Exit Event of that control, but I am not sure what code would ... accomplish this. ...
    (microsoft.public.access.formscoding)