+ Reply to Thread
Results 1 to 9 of 9

issue with a userform not hiding, the commands are right though

  1. #1
    Forum Contributor
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    2016
    Posts
    862

    issue with a userform not hiding, the commands are right though

    here is the code table from userform6

    'Control Budget" userform button
    Please Login or Register  to view this content.
    and here is the code for the COS button

    Please Login or Register  to view this content.
    here is the snippet of code from "Grand10"

    Please Login or Register  to view this content.
    if i turn off me.hide in my buttons then the userform does not close.

    if i change the code above for this, then my error is "run time error 402 - must close or hide topmost modal form first"

    Please Login or Register  to view this content.
    i do have a userform4 that closes (runs before the above code) properly, so not sure what it is complaining about.

    thoughts anyone?

  2. #2
    Forum Expert
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2010 primarily
    Posts
    2,001

    Re: issue with a userform not hiding, the commands are right though

    It's really hard to debug things like this without the workbook as it typically means you have got a chain of code that is wrong.

    Why are you trying to hide a form that appears to have already been hidden by the earlier button code?
    Rory
    If a job's worth doing, it's worth doing right
    over your shoulder by your boss

  3. #3
    Forum Contributor
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    2016
    Posts
    862

    Re: issue with a userform not hiding, the commands are right though

    cause its not hiding. let me upload a workbook with the code:

    so i am attaching two workbooks. the parent (SheetsForConstructionAndImportingIntoViewpoint - FROZEN - for upload.xlsm) and the target workbook (Bay Main House CO6 - for upload.xlsx)

    open up the parent, go to "navigation" sheet, click on "Import sheets"

    from userform4, select "Navigate" and then click to the target workbook (where ever you saved it).

    then userform6 opens (and never closes)

    can you work with this?

  4. #4
    Forum Expert
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2010 primarily
    Posts
    2,001

    Re: issue with a userform not hiding, the commands are right though

    Before I do, did you by any chance turn screenupdating off before showing the form?

  5. #5
    Forum Contributor
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    2016
    Posts
    862

    Re: issue with a userform not hiding, the commands are right though

    yes a couple of lines before i show userform6. is that a problem?

  6. #6
    Forum Contributor
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    2016
    Posts
    862

    Re: issue with a userform not hiding, the commands are right though

    i commented it out, doesnt appear to fix the issue though

  7. #7
    Forum Expert
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2010 primarily
    Posts
    2,001

    Re: issue with a userform not hiding, the commands are right though

    Try explicitly turning it on before showing the form. If that doesn't help, I'll have a look when I have a minute.

  8. #8
    Forum Contributor
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    2016
    Posts
    862

    Re: issue with a userform not hiding, the commands are right though

    thanks rorya, im pulling my hair out and i don't have much left.

    i explicitly turned it on and reran the code. no luck.

  9. #9
    Forum Contributor
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    2016
    Posts
    862

    Re: issue with a userform not hiding, the commands are right though

    so i finally figured it out. i replaced all the me.hide and userform#.hide with unload, like so:

    Please Login or Register  to view this content.
    that made the code work. don't know why though.

    thoughts?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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