In the app's main form's Unload event I have this code:
Now, there's a button in the main form that when clicked on shows a second form in modal style:
frm2.Show 1
If I close this form hiding it instead of unloading it, then when the above Unload code runs the program does not terminate (I'm working in the IDE) so I have replaced frm2.Hide by Unload Me (frm2) and now program ends corrcetly.
The question is, if there wrere reasons for using frm2.Hide instead of Unload frm2, could I place the unload statements in the main form's unload event like this?
Code:
For Each Frm In Forms
Set Frm = Nothing
Next
frm2.Show 1
If I close this form hiding it instead of unloading it, then when the above Unload code runs the program does not terminate (I'm working in the IDE) so I have replaced frm2.Hide by Unload Me (frm2) and now program ends corrcetly.
The question is, if there wrere reasons for using frm2.Hide instead of Unload frm2, could I place the unload statements in the main form's unload event like this?
Code:
For Each Frm In Forms
Unload Frm 'Is this OK?
Set Frm = Nothing
Next