G
Guest
Hello -
I have an application with a background form and many other forms. The
background form has the 'X' part of the control box to close the form to exit
the application. I thought it would be nice to give a user the opportunity
to change their mind if they incorrectly clicked on the 'X,' and return them
to the form they were on. I have the following code, but I need the part
(the hard part) in capital letters below:
Private Sub Form_Unload()
If Me.Visible = True Then
'Exit application - give user one chance to change their mind
Dim frm As Form
NEED CODE FOR FORM USER IS CURRENTLY ON
If MsgBox("You are about to completely exit Call Tracking." &
Chr(13) & _
"Are you sure you want to do this?", vbYesNo + vbExclamation,
"Exiting Database") = vbNo Then
NEED CODE HERE TO KEEP BACKGROUND FORM VISIBLE
AND ALSO PARTICULAR FORM USER IS ON
Else
'Unload all forms and remove from memory
For Each frm In Forms
frm.Hide
Unload frm
Set frm = Nothing
Next
End
End If
Else
End If
Any help will be greatly appreciated!
I have an application with a background form and many other forms. The
background form has the 'X' part of the control box to close the form to exit
the application. I thought it would be nice to give a user the opportunity
to change their mind if they incorrectly clicked on the 'X,' and return them
to the form they were on. I have the following code, but I need the part
(the hard part) in capital letters below:
Private Sub Form_Unload()
If Me.Visible = True Then
'Exit application - give user one chance to change their mind
Dim frm As Form
NEED CODE FOR FORM USER IS CURRENTLY ON
If MsgBox("You are about to completely exit Call Tracking." &
Chr(13) & _
"Are you sure you want to do this?", vbYesNo + vbExclamation,
"Exiting Database") = vbNo Then
NEED CODE HERE TO KEEP BACKGROUND FORM VISIBLE
AND ALSO PARTICULAR FORM USER IS ON
Else
'Unload all forms and remove from memory
For Each frm In Forms
frm.Hide
Unload frm
Set frm = Nothing
Next
End
End If
Else
End If
Any help will be greatly appreciated!