>>Thanks Rick And Larry!!!
>>
>>From now since i know the problem, i decide to solve it hardcoding 'controls(1)'
>>
>>FOR i = 1 TO _SCREEN.CONTROLCOUNT
>> _SCREEN.REMOVEOBJECT(_SCREEN.CONTROLS(i).NAME)
>>ENDFOR
>
>I think you mean
> _SCREEN.REMOVEOBJECT(_SCREEN.CONTROLS(1).NAME)
>
>IAC, you could also use the ControlCOunt property in the RemoveObject line. I saw this technique in a message by Ed Rauh last week:
>With _Screen
> for i = 1 TO .ControlCount
> .RemoveObject(.Controls(.ControlCount).Name)
> endfor
>Endwith
>The range for i is pre-initialized but ControlCount continually changes during the process. This will always remove the last object in the collection.
Ariel,
I added a new FAQ entry ~ month ago 'How to release all open forms'. Take a look FAQ #7975692. I may add Ed's code as well, thanks, Larry.
If it's not broken, fix it until it is.
My Blog