Results 1 to 4 of 4

Thread: Unloading a Project

  1. #1
    Guest
    I've tried unloading all forms in my app, but I'm hanging up when I exit my app. My app has a number of forms that allow the user to go 'back' or 'next'. I show a form, then hide the current form when they click on 'back' or 'next'. After the current form is hidden I show the new form and keep doing this until all forms have been displayed and 'next' is clicked one last time. My app exits fine if the user never clicks 'back'.

    I use query unload to verify an exit from the user. If accepted, I call a procedure to unload all forms.

    Dim Frm As Form

    For Each Frm In Forms
    Unload Frm
    Set Frm = Nothing
    Next Frm
    End

    I have noticed that if a form is displayed more than once it runs the query unload more than once. I don't know why, because I'm only making the form invisible, then visible again, so there shouldn't be more than one instance of it, right?

    Thanks in advance for your replies.

  2. #2
    Addicted Member
    Join Date
    Aug 2000
    Location
    Fremont Ohio 43420
    Posts
    253
    In your form load for each form use this code to only have one instance for each form

    private sub form_load

    if app.previnstance = true then
    end
    end if

    Hope this helps because now your forms should only show up one time even if the user tries to open the same form again.

  3. #3
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Use Unload Me instead of end. It will Unload the form from the memory, closes open files and all sort of things to properly quit your prog.
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  4. #4
    Guest
    Form load is only running once, but form activate runs every time I make a form visible. I am using vbmodal forms.

    I am trying to end my program with using only unloads, but I'm still locking up on exit.


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