+ Reply to Thread
Results 1 to 4 of 4

Unloading Form Throwing Error

  1. #1
    Registered User
    Join Date
    03-19-2018
    Location
    Goulburn
    MS-Off Ver
    MS Office Professional Plus 2016
    Posts
    35

    Unloading Form Throwing Error

    Hey everyone,

    Back at it again, I am up to loading in the data into the database but there is one error i can't get rid of.

    i can't unload CheckForSongUserForm

    I am unloading no different to before, i have tried unload me, nothing keeps giving me "object variable or with block variable not set"

    If i hover over the CheckForSongUserForm it has an assign error, it seems to be treating it like a variable, i haven't set a variable with that name


    Any help would be great

    Thanks

    Bensley
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    05-12-2018
    Location
    Netherlands
    MS-Off Ver
    2016
    Posts
    266

    Re: Unloading Form Throwing Error

    Place the code in the userform activate event instead of the initialize event.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: Unloading Form Throwing Error

    Please Login or Register  to view this content.
    Don't call the UserForm_Terminate procedure to terminate the userform. That procedure is automatically triggered when the userform is terminated by command or when the user clicks the X in the upper right of the form. Just use Unload Me and delete the UserForm_Terminate procedure.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    03-19-2018
    Location
    Goulburn
    MS-Off Ver
    MS Office Professional Plus 2016
    Posts
    35

    Re: Unloading Form Throwing Error

    Ah so you can't unload if your only initializing

    how would i stop it showing the form behind, because now instead of a clean nothing shows unless there is an acutal match to go in the listbox, it pops up behind the msg box, and will load even if i turn msg box off with module1.FinishCheck

    any ideas?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Unloading a Form
    By VBA Fun in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-25-2019, 12:52 AM
  2. Replies: 2
    Last Post: 07-09-2012, 12:28 PM
  3. Unloading Form on clear contents
    By reggie1000 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-20-2009, 11:10 AM
  4. Lose cursor after unloading form
    By andreco in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-12-2008, 03:39 PM
  5. Unloading / closing a form with the escape key
    By Bettergains in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-11-2006, 02:45 PM
  6. Form not unloading before next code line
    By Michael Beckinsale in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-11-2006, 09:30 AM
  7. [SOLVED] Strange issue freezing parent form when unloading a child form
    By Stefano Gatto in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-11-2005, 12:45 PM
  8. Unloading a form using the ESC key
    By johncassell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2005, 01:19 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1