Re: Editbox lost focus issue by Gene
Gene
Thu Oct 19 18:07:18 CDT 2006
[reordered to chronological]
"Lew Schwartz" <lschwartz@sionline.com> wrote:
>"Gene Wirchenko" <genew@ocis.net> wrote in message
>news:o7lfj25dvhe58ango6jbb7mqadu2rb61bd@4ax.com...
>> "Lew Schwartz" <lschwartz@sionline.com> wrote:
>>
>>>I can't reproduce the following 100% of the time, but it seems to me that
>>>if
>>>I exit an editbox in one of my forms by clicking on a listbox (and/or
>>>perhaps elsewhere) on the same form, the underlying tables are not always
>>>updated properly. The update is accomplished via sql statements in the
>>>lostfocus() event of the control. There is no controlsource and the fields
>>>in question are character memo fields. The lb does drive the table that
>>>stores the data, but I can verify that this is not a case of the data
>>>being
>>>written to the wrong record. One obvious question is: Is there any way to
>>>exit an eb control that won't fire the lostfocus() event?
>>>TIA.
>>
>> I am not sure what you are complaining about. Is it:
>>
>> 1) Sometimes, the underlying tables are not being updated, and they
>> should be.
>>
>> 2) Sometimes, the underlying tables are being updated, and they
>> should not be.
>>
>> Clicking on a toolbar item will not cause a loss of focus. This
>> means that the updating will not happen. If the toolbar action causes
>> the data to be updated, it will not have the new value for the last
>> control that you were entering into. Is this what you are wondering
>> about?
>It's #1 Gene, thanks. There are no toolbars around, just other controls on
>an otherwise plain vanilla form.
What you are describing is the problem when a toolbar comes into
the picture. Clicking on a toolbar button does not result in a loss
of focus for the form, becauase the toolbar does not get focus. This
is a deliberate design, but it causes the problem you state.
If this is actually your problem, you need something to force a
focus loss when a toolbar button is clicked (or whatever it is that is
getting worked on without getting the focus). (I first wrote
"activiated", but that is something else.)
What I did in the toolbar was to create a form and display it
off-screen. That got the focus. More importantly, that means that
the data control loses the focus, and that loss triggers the
validation. I assume that this approach would also trigger your
.lostfocus() code.
I hope this helps, but I really do not have enough detail to be
sure. (Your claim of no toolbars is the puzzling bit. I do not know
what else can become active without getting the focus besides a
toolbar. Does anyone else know?)
Sincerely,
Gene Wirchenko
Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.