English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I tried using unloading the form first and then showed another form that was unloaded earlier, but it doesn't work...

what i did was:

in frmLogin:
Unload Me
frmTrainers.Show

in frmTrainers:
'in cmdLogout

Unload Me
frmLogin.Show
'I also tried frmLogin.Visible = True
'and also tried frmTrainer.Hide
'waaaah

2007-10-14 21:12:59 · 1 answers · asked by kerocute3 1 in Computers & Internet Programming & Design

1 answers

Once a form is unloaded it no longer exists so to goback an use an unloaded form requires it to be reloaded.

If you are trying to execute a section of code (logout command) first before exiting your program try using the QueryUnload event.

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

End Sub

This event fires before the form is unloaded and allows you to check why the form is closing and gives you an opportunity to cancel or delay the closing by executing code within the event.

In the query unload event you can issue a call to your logout function and wait until the logout acknowledges it has completed before allowing the form to close and terminate the program

2007-10-15 00:38:24 · answer #1 · answered by MarkG 7 · 0 0

fedest.com, questions and answers