>Rich,
>
>You sould use _Screen.ActiveForm to reference currently active form
POP MENU _msysmenu
>IF TYPE("_Screen.ActiveForm") = "O"
> _Screen.ActiveForm.Release()
>ENDIF
>
You've heard it before.......here it is again.
Many thanks for your help
.........Rich
>>I have a program which does some stuff, then modifies the menu bar and issues a READ EVENTS
>>
>>
>>DO stuff
>>DO myFirstMenu.mpr
>>DO more stuff
>>READ EVENTS
>>
>>
>>In one of the pads in MyFirstMenu I issue the command
DO nnn.app
>>
>>In this app I want to replace the menu and open a form. Both the new menu and the form have Close options as follows
>>
>>
>>PUSH MENU _msysmenu
>>DO namennn.mpr
>>DO FORM namefind NAME oNameForm
>>
>>
>>In the form NAMEFIND there is a CLOSE button with the following code
>>POP MENU _msysmenu
>>Thisform.release()
>>
>>In the menu bar there is also a close pad with the code
>>POP MENU _msysmenu
>>oNameForm.release()
>>
>>
>>The CLOSE button on the form works just fine. However, the CLOSE option on the menu gives an error
Object ONAMEFORM is not found
>>
>>What am I doing wrong and how can I code this to have the menu option close the form?