M
Michel S.
Hi !
I currently experience a problem with an application.. Under a certain
situation (see below), I get errors 2001 (if I try to go to a new
record) or 2110 (if I try to set the focus to another control before).
With a combo, if I click on the arrow to open the dropdown and then
close it without making a selection either by clicking on the same
arrow again or by pressing the escape key, it seems I can't
programatically remove the focus from that control.
To make sure it's the case, I wrote a simple form procedure which
executes juste before the "goto next record" function.
The procedure pops a msgbox listing the Form.ActiveControl.Name, the
other's control (a textbox) Name, Visible, Enabled and Locked state
(nothing wrong there). So far so good.
The next procedure line of code is : txtOtherFormControl.SetFocus
I'm granted with the 2110 error (Can't move the focus to that other
control's name).
OTOH, if I click on that other control before changing record
everything's fine.
My questions :
1) Is it possible to detect (and clear) this state of a combo box ?
2) Any idea on how to programatically set the focus to that other
control - or at least remove it from the combo ?
I'm using Access 2002.
Thanks !
FU2: microsoft.public.access
I currently experience a problem with an application.. Under a certain
situation (see below), I get errors 2001 (if I try to go to a new
record) or 2110 (if I try to set the focus to another control before).
With a combo, if I click on the arrow to open the dropdown and then
close it without making a selection either by clicking on the same
arrow again or by pressing the escape key, it seems I can't
programatically remove the focus from that control.
To make sure it's the case, I wrote a simple form procedure which
executes juste before the "goto next record" function.
The procedure pops a msgbox listing the Form.ActiveControl.Name, the
other's control (a textbox) Name, Visible, Enabled and Locked state
(nothing wrong there). So far so good.
The next procedure line of code is : txtOtherFormControl.SetFocus
I'm granted with the 2110 error (Can't move the focus to that other
control's name).
OTOH, if I click on that other control before changing record
everything's fine.
My questions :
1) Is it possible to detect (and clear) this state of a combo box ?
2) Any idea on how to programatically set the focus to that other
control - or at least remove it from the combo ?
I'm using Access 2002.
Thanks !
FU2: microsoft.public.access