For my mnuExit_Click event I am currently using:
unload frm1
unload frm2
etc...
I know there's a better way. Could someone pls share?
Thank you
Flint
Printable View
For my mnuExit_Click event I am currently using:
unload frm1
unload frm2
etc...
I know there's a better way. Could someone pls share?
Thank you
Flint
End - It atleast unloads all the forms and quits the program.
You could also have everything in your Form_Unload. Call it like Call Form_Unload at any item you want to have the quit.
I generally use a global sub so no matter where the exit is called it uses the same code:
Using just 'End' can cause memory lagCode:Public Sub CloseAll()
'Closes all open recordsets using de as a data environment
For X = 1 To de.Recordsets.Count
If de.Recordsets.Item(X).State <> asStateClosed Then
de.Recordsets.Item(X).Close
End If
Next X
'Closes all open forms
For Each Form In Forms
Unload Form
Next
'Makes sure the program ends
End
End Sub
[Edited by Edneeis on 11-27-2000 at 02:55 AM]
Thanx...That's What I was looking for. Thank you for your thought and precious time.
Flint