Noman:
If you are using VFP 6.0, it is possible to add Setup and Cleanup code to a popup menu. I have popup menus that are activated by a Rightclick. The Setup section creates a Public variable that is an Object, assigns the parameter that I pass in to the Public Variable and I use various methods and properties associated with the object. In the Cleanup, I set the Public variable to .NULL. and release the variable.
To be able to add Setup/Cleanup items, add a new menu or edit an existing menu item. The VFP menu includes an option under View name General Options. Select this item. You'll see checkboxes for Setup and Cleanup. If you check them, you can add code the the editbox on the screen.
NOTE: This feature is NOT available in 5.0a.
HTH
Mike
Mike