>I have created an array to access several command buttons in the forms init procedure.
>
>Public Array MyArray[2]
>MyArray[1] = Thisform.cmdOne
>MyArray[2] = Thisform.cmdTwo
>
>In another command buttons click event, I have the following code.
>
>For i = 1 To 2
> MyArray[i].Caption = "Test " + Alltrim(Str(i))
>EndFor
>
>When I run the form the command button works properly and changes the captions on the other buttons. But when I attempt to exit the form I get an error message...
>
>File cannot be closed because outstanding references exist.
>Can anybody help me out?
>Thanks in advance for any help offered.
>
>John Symons
All such references should be set to .NULL. in form destroy event. In your case it means MyArray=.NULL.
Also, you could consider using form's property-array, it's better way.
Edward Pikman
Independent Consultant