Re: timing of updating data from a control by Paul
Paul
Fri Jan 12 12:10:02 CST 2007
Because if I remember right, in either interactivechange or in click, I
don't know whether the new value of the checkbox will be .T. or .F.
In any case, #2 is simpler, especially since the counting routine can be
called from other places as well.
"Gregory Adam" <GregoryAdam@PleaseReplyViaNewsGroup.com> wrote in message
news:edeVVEjNHHA.3944@TK2MSFTNGP06.phx.gbl...
> Paul,
>
> The controlSource gets updated when the focus moves off the control
>
> Why not use suggestion #4 ?
>
> Gregory
> _
> "Paul Pedersen" <nospam@no.spam> wrote in message
> news:uXuqYkgNHHA.1252@TK2MSFTNGP02.phx.gbl...
>> OK, I figured out why my previously-usually-reliable timer method wasn't
>> working in this case. I had a buffered table, and forgot to put WITH
>> BUFFERING in my count query. Duh. And oops!
>>
>> But your setfocus method works even better than the timer. So, thanks! I
>> just put THIS.SETFOCUS in interactivechange, then call the count routine
>> and it works like a charm. Now I can get rid of that timer junk.
>>
>> Thanks again.
>>
>>
>>
>> "Paul Pedersen" <nospam@no.spam> wrote in message
>> news:eXo1UOgNHHA.4928@TK2MSFTNGP06.phx.gbl...
>>> Thanks for the suggestions. Believe it or not, I had already tried all
>>> of them except changing the focus. Unfortunately, that didn't work
>>> either. Neither did moving it all into the click method.
>>>
>>> Surprisingly enough, the method that works most often is still the
>>> timer. But it's far from reliable.
>>>
>>> The problem with using an external counter is that it's difficult to
>>> tell whether the user is checking or unchecking the box.
>>>
>>>
>>>
>>>
>>> "Paul Pedersen" <nospam@no.spam> wrote in message
>>> news:O4OnGiRNHHA.536@TK2MSFTNGP02.phx.gbl...
>>>> When changing data via a control bound to a data source, there is some
>>>> delay until the change actually registers. This is a particular problem
>>>> with a check box in a grid, where I am trying to count the number of
>>>> .T. values in that field. I usually have interactivechange trigger a
>>>> timer which waits a couple tens of a second, then performs the count
>>>> routine. However, this is not reliable.
>>>>
>>>> For instance, if I change the value of myfield clicking a checkbox
>>>> bound to mytable.myfield, then issue
>>>>
>>>> SELECT COUNT(*) FROM mytable WHERE myfield
>>>>
>>>> the count is invariably off by one until after some period of time has
>>>> passed, which may be as long as a second or so.
>>>>
>>>> All data is local, no network is involved. The table has about 5000
>>>> records.
>>>>
>>>> Anyone have a good solution?
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>