Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refresh after checkbox in grid changes value
Message
 
 
To
09/05/2005 16:27:43
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Pro
Miscellaneous
Thread ID:
01012247
Message ID:
01012279
Views:
29
>>>I have a grid where the user needs to select some records. The last column has a checkbox (text1 removed, .currentcontrol="chk") bound to a logical field. Grid's recordsource is a readwrite cursor.
>>>
>>>My problem is the total field, in another cursor, shown in a readonly textbox below the grid. I'm calling the counting code from checkbox's .interactive change, and it sometimes fires, sometimes not. Most often, it works on/off, i.e. once works, once doesn't. I've tried several known tricks - before calling the code, do
>>>
>>>1. dodefault()
>>>2. this.value=this.value
>>>3. this.setfocus()
>>>4. go recno()
>>>5. calling the calculation from .lostfocus instead
>>>
>>>None of this works - the calculation is never sure to see the last change. It either sees the last change sometimes, or never - depending on which trick I try. So, how do I get the change written into the controlsource and be sure that the calculation routine sees it? From where do I call it?
>>>
>>>Update: the last sentence gave me the idea. I'm now doing this:
>>>
replace (this.ControlSource) with this.Value
>>>nodefault
>>>thisform.de.CalculateIM()
>>>And it works. Thanks to Auntie Emma.
>>
>>this.value = this.value should have been sufficient. The question is: what do you do in that routine? May be you're doing some SELECT statements? If this is the case and you're working with the buffered data, your changes would not be seen until commited.
>
>This is a created cursor. No buffering, and yes I do select.

Interesting. It sounds like your cursor is not getting updated. Can you investigate why?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform