|
-
Sep 27th, 2000, 11:48 AM
#1
Thread Starter
Lively Member
I am writing an application which has a login screen and
a log off button.
When the application loads the login screen is display. The user logs in and a MDI form is shown with various forms positioned within it (thanks megatron for the code to remove MDI resizing).
The user will press a button to log off -- this will trigger all forms to be set to nothing, the mdi form to unload and the logon screen to be shown again.
How do I unload a mdi form from a logoff button without closing the application?
-
Sep 27th, 2000, 11:54 AM
#2
PowerPoster
Not sure but
What happens if the login form is NOT a MDIchild (vbmodal)? If you close the MDIform, it may not close the application. Try it and let me know...
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Sep 27th, 2000, 12:42 PM
#3
Thread Starter
Lively Member
The login form is not a MDI Child and it does cloes
the application properly.
What I need is a button on a MDI Child form which, when
pressed, will terminate all the forms Including the MDIform
and then show the login form.
In other words, it's a never ending cycle. Once
the application is loaded, the only way a user could
actually exit the application is by using a specific
login and password. For example, a login of say, Good, and a password of Bye would be the only way the user could
close the application. This way only certain users would
have the ability to stop the application.
-
Sep 27th, 2000, 12:56 PM
#4
PowerPoster
Ok my next attempt...
On your close event...
Dim Form As Form
For Each Form In Forms
Unload Form
Set Form = Nothing
Next Form
End
then
frmLogin.Show
Would this work?
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Sep 27th, 2000, 03:32 PM
#5
Thread Starter
Lively Member
Thanks
My biggest mistake was I was manually typing in the
unload statement and referring to the MDI form with it's
name not the name of the variable set as the MDI form.
Using your example of course, cleared that problem and
showed me where I went wrong.
Your suggestion worked perfectly.
Thanks
-
Sep 27th, 2000, 04:40 PM
#6
PowerPoster
rlb_wpg:
Your quite welcome. I'm glad I could help (even though it wasn't exactly what you needed).
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|