Sergey,
I said in my first reply that I would try again this morning, putting the original code back into the "DisableFields" method.
Well I did so and, as before, the FIRST disable worked as expected. However, when executed again after a (successful) enable had been done it failed with the same error message!
There is no failure with the workaround coded in both.
My only guess remains that things get confused internally at some point, possibly because I make heavy use of WITH/ENDWITH.
cheers
>Jim,
>
>I'm glad that you solved your problem but I still baffled why it didn't work in the first place.
>
>>I forget, Sergey, but the problem is SOLVED!!!
>>
>>MSKB #
Q195533 describes a situation of the same error message with a COM object and suggested a workaround.
>>
>>Using that I coded:
Local xq
>>xq = This.TypeSelector.OBJECT
>>xq.Enabled = .T.
>>xq = NULL
>>
>>and the error message stopped and I can now enable the treeview.
>>
>>Thanks for your help.
>>
>>>Jim,
>>>
>>>If you suspend execution at the time of error does
ThisForm.TypeSelector.OBJECT.Enabled = .T.
works from command window or errors out?
>>>
>>>>I don't see a mis-type... I copied the disable statement to under the enable statement and they both are identical except the other side of the equal sign.
>>>>
>>>>I first had it coded under a "WITH ThisForm" and got the error trying to enable then too.
>>>>
>>>>I too have no problem with both those statements in a 'simple' form, but the error is consistent in THIS damned form#@$!#@$!%@$