Results 1 to 5 of 5

Thread: Loading of forms

  1. #1

    Thread Starter
    Member
    Join Date
    May 2000
    Location
    NY
    Posts
    47
    Hi.

    I am encountering a weird error in my program. I have 2 forms and each form has a command button. When I click the command button from Form1, Form2 will be loaded. If I click the command button from Form2, I am unloading the form (by Unload Form2 function). However, after that, it performs again the "Load" event of Form2. In this case, loading of form 2 is being done twice. Even if I am just loading form2
    from the command button of form1.

    What's the possible cause of this occurrence?

    Thank you very much.

    Regards,
    Rowena

  2. #2
    Guest
    It's probably something in your code. Check and see if your code is similar to the following.

    In Form1
    Code:
    Private Sub Command1_Click()
        'Show Form2
        Form2.Show
    End Sub
    In Form2
    Code:
    Private Sub Command1_Click()
        'Unload Form2
        Unload Form2
    End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    May 2000
    Location
    NY
    Posts
    47
    Hi Megatron.

    You know what, I have the same code as what you post here.

    That's why this is so weird for me.

    Thanks,
    Rowena

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    just a thought..perhpas it is hanging in memory.

    Form1 cmdbutton

    unload form1
    set form1 = nothing
    load form2
    form2.show
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  5. #5

    Thread Starter
    Member
    Join Date
    May 2000
    Location
    NY
    Posts
    47
    Thanks HeSaidJoe! I got it! I just set form2 to nothing in unload event of form2.

    Thanks a lot.

    Regards,
    Rowena

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width