>Hi,
>
>I have come across the following issue and hope that I am missing something simple. Here is the summary of the situation:
>
>A textbox on a form is bound to a cursor with buffering 5. When user changes the value of the control the method InteractiveChange of the textbox calls a method of the form. This method checks if there are any changes in the buffer using
>
>cRetVal = GETFLDSTATE( -1, "C_CURSNAME" )
>
> And the return from GetFldState() has all "1"s as if nothing has been changed.
>
>Yes, if I put SET STEP ON in the method and step through the code, the GetFldState() returns the string that has one "2" as it should be. My question is, why without debugger the GetFldState() does not see any changes and with the debugger it does? I also tried using CURVAL() for the field and the same thing happens. Without debugger the CURVAL() returns old value but with the debugger the change is perceived.
>
>UPDATE. Looks like calling REFRESH() takes care of the problem.
>UPDATE 2. No, REFRESH() does not solve the problem.
Dmitry,
If memory serves .... As long as your textbox has the focus, getfldState() will not see the changes
Solution - (add error handling)
If thisform.ActiveControl has a ControlSource
if( eval(m.thisform.ActiveControl.ControlSource) <> thisform.ActiveControl.Value )
=m.thisform.ActiveControl.SetFocus()
endif
endif
Gregory