Unload form on form_load 
Author Message
 Unload form on form_load

I know that we can not unload a form when it's loading on form_load.
We receive an error message.

So, what can we do when we DO wnat to unload a form when it's
loading???

Exemple:
form_load()
    open the database.
    check if the table is empty.
    If table is empty
        send a message
        unload the form
    else
        continue
    end if
end sub



Wed, 20 May 1998 03:00:00 GMT  
 Unload form on form_load
This is an easy one.

#1)  If this is your primary form and you want to exit the application,

form_load()
    open the database.
    check if the table is empty.
    If table is empty
        send a message
        END
    end if
end sub

form_unload()
   UNLOAD MAINFORM
end sub

(Note: MAINFORM in my case is the form DEMO.FRM but the name of the form
is MAINFORM.)

#2) If this isn't your primary form and you are just wanting to return to
the primary form, issue the UNLOAD when you return to the primary form.

Take care.
-Dan Swaney "The Swaynster"
_________________________________________________________________________________________

Quote:


>I know that we can not unload a form when it's loading on form_load.
>We receive an error message.

>So, what can we do when we DO wnat to unload a form when it's
>loading???

>Exemple:
>form_load()
>    open the database.
>    check if the table is empty.
>    If table is empty
>        send a message
>        unload the form
>    else
>        continue
>    end if
>end sub

--

"Go Eagles Go!"



Thu, 21 May 1998 03:00:00 GMT  
 Unload form on form_load

Thanks for your help.

Quote:
>#2) If this isn't your primary form and you are just wanting to return to
>the primary form, issue the UNLOAD when you return to the primary form.

That's my case. I have already tried what you're suggesting and it
doesn't work.

Try this simple example, please.

Create 2 forms: form1 and form2.

On form1 place:

Sub Form_Load ()
    Form2.Show MODAL
End Sub

On form2:

Sub Form_Load ()
    Unload Me
End Sub

You will receive the error message that I'm meaning.
Solving this puzzle, it will solve the problem with my app.



Thu, 21 May 1998 03:00:00 GMT  
 Unload form on form_load

Nhuch) threw this at us:

Quote:
>Create 2 forms: form1 and form2.
>On form1 place:
>Sub Form_Load ()

     On Error Resume Next

Quote:
>    Form2.Show MODAL
>End Sub
>On form2:
>Sub Form_Load ()
>    Unload Me
>End Sub

That's what removed my error message

Jens
--
* Everything I said are the opinions of someone else.   *
* I just cut-and-pasted.                                *

Jens Balchen jr.



Fri, 22 May 1998 03:00:00 GMT  
 Unload form on form_load

Quote:

>Try this simple example, please.

>Create 2 forms: form1 and form2.

>On form1 place:

>Sub Form_Load ()
>    Form2.Show MODAL
>End Sub

>On form2:

>Sub Form_Load ()
>    Unload Me
>End Sub

>You will receive the error message that I'm meaning.
>Solving this puzzle, it will solve the problem with my app.

Set some global flag to indicate that an error occurred in the
Form_Load event procedure, then place "Unload Me" onto the
Form_Activate event procedure of Form2.

Puzzle solved? ;)

--
Haluk Okur / SIMKO A.S.       (Siemens in Turkiye)

Tel   : +90 (216) 389-5940, ext 4563                             -\<,
Fax   : +90 (216) 306-2548                                  ___(*)/(*)___



Fri, 22 May 1998 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Help please? unloading form in form_load

2. Unload form in Form_Load event

3. Unloading a form in the Form_Load event

4. Unloading modal owner form also unloads modal form?

5. unload in Form_load event

6. Unload in Form_Load

7. Help please: unload in form_load causes error

8. Unloading form gives 364 Object was unloaded

9. Unload form doesn't unload

10. Unload not unloading a hidden form - VB4 32bit

11. Problem getting program to end after unloading the form (Unload Me)

12. Form.Close in Form_Load

 

 
Powered by phpBB® Forum Software