Re: Control Exit event kills Button Click Event in Access2002 Form
From: Mike Elliott (Elliott_at_discussions.microsoft.com)
Date: 10/20/04
- Next message: Mike Elliott: "RE: List box"
- Previous message: Jeff Klein: "Setting the forms width"
- In reply to: Dirk Goldgar: "Re: Control Exit event kills Button Click Event in Access2002 Forms"
- Next in thread: Dirk Goldgar: "Re: Control Exit event kills Button Click Event in Access2002 Form"
- Reply: Dirk Goldgar: "Re: Control Exit event kills Button Click Event in Access2002 Form"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 20 Oct 2004 08:51:02 -0700
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.
I created a new form to test this with. I dropped 3 fields onto it as well
as a command button. The Exit event for the first field moves to the third
field. The Button just displays a message.
When I click the button, the focus moves to field 3. When I click it again,
my message is displayed. If I select the second field (with no exit event)
and click the button, my message displays immediately.
However, I then went back and tested this simple form in Access97 and it
behaves exactly the same way. I had never noticed this behavior before. I
was wrong earlier when I said that they behaved differently. I should have
done the simple test in both versions before posting the question.
I appreciate the quick responses and hope I have not wasted your time.
Mike
"Dirk Goldgar" wrote:
> "Mike Elliott" <Mike Elliott@discussions.microsoft.com> wrote in
> message news:5F325D6E-F4E4-40B6-A21D-43F1DD879B6A@microsoft.com
> > Access 2002 Forms behave differently than Access 97 Forms.
> >
> > ControlA has the Focus and I click ButtonB. If there is an Exit
> > event for ControlA, it will Fire, but the Click Event procedure for
> > Button B never fires.
> >
> > In Access 97, The Exit Event would have fired and then the Click
> > event for the button would fire.
> >
> > My workaround was to use the Change event where possible and not the
> > Exit or LostFocus events.
>
> I'm using Access 2002, and I don't see the misbehavior you describe.
> Are you sure you aren't doing something in the Exit event for ControlA
> that would prevent ButtonB from receiving the click? Canceling the
> event, perhaps?
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
>
>
- Next message: Mike Elliott: "RE: List box"
- Previous message: Jeff Klein: "Setting the forms width"
- In reply to: Dirk Goldgar: "Re: Control Exit event kills Button Click Event in Access2002 Forms"
- Next in thread: Dirk Goldgar: "Re: Control Exit event kills Button Click Event in Access2002 Form"
- Reply: Dirk Goldgar: "Re: Control Exit event kills Button Click Event in Access2002 Form"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|