>>I have a form with several command buttons on it. When one of these buttons is pressed, all of the buttons are disabled and another form opens within the first. When I close the second form I want to enable the buttons on the first form but I don't know what syntax to use or what event to put it in. I can't use gotfocus() because the user could simply click in the first form without exiting the second form first. For example, if form1 had report and inventory buttons, when the user clicks reports the 2 buttons are disabled and a form with report options appears. When the user is done reporting and closes form 2 the 2 buttons on form2 should be enabled. Any help would be appreciated.
>
>In the 2nd form's destroy method you could call a custom method on the 1st form to enable your buttons.
To expand a little on this, you can store an object reference of form1 to a preperty of form2. In the Load (or Init) event of Form2, add the following:
THIS.oFormRef = _Screen.ActiveForm
ActiveForm holds an object reference to Form1 until the Activate event of Form2 fires. Then in the Destroy event of Form2, along with the Form1 method call, set the form2 property to .NULL. to avoid dangling object references.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao