+ Reply to Thread
Results 1 to 14 of 14

userform.show issues

  1. #1
    Forum Contributor
    Join Date
    12-27-2012
    Location
    cebu, Philippines
    MS-Off Ver
    Excel 2016
    Posts
    210

    userform.show issues

    I created a file with 4 userforms..

    now I am very certain that the syntax is good, but for some reasons, excel vba is not showing the userform...
    is it possible that a userform.show method can only be used in a module only once for each userform?

    I tried
    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    but it stops with an error 1004

    need help...
    don't worry, there's a lot of people that are far more confused than you
    but if you liked what i suggested. Click for me the "Add Reputation" - that way, we'd be both happy.

  2. #2
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Ontario Canada
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: userform.show issues

    VBA should be able to display the code as many times as you need.
    When a user form is loaded, the code "UserForm_Initialize" is automatically run.
    I think what is happening is that there is an error in that code.
    Put a break point on userform, and when it stops, press F8 and step into the code and see where it breaks apart.

  3. #3
    Forum Contributor
    Join Date
    12-27-2012
    Location
    cebu, Philippines
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: userform.show issues

    I have nested if statements on it ..
    the userform initialize procedure works perfectly fine.. I got all the comboboxes filled with the list needed, and the textboxes customized based on the cells,
    the procedure I have problem with occurs on the buttonclick procedure...
    I wanted it to load another userform after the user enters some information on an existing userform's textbox...

    thus I have the code

    Please Login or Register  to view this content.
    I even tried this: (if the msgbox appears, then the trainer.show command has been already initiated)

    Please Login or Register  to view this content.
    it shows the msgbox, but the userform is still not flashing on the screen...

  4. #4
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Ontario Canada
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: userform.show issues

    So then when do you get the RunTime 1004 error?

  5. #5
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Ontario Canada
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: userform.show issues

    Also, you say that the user form initialize works perfrectly fine but it sounds like you have two separate forms. So they would have two different initialize functions.
    Unless you are trying to open up 2 instances of the same form at once? But it doesnt seem like it because you have one form called LogIn and one form called Trainer.
    So I would guess that the initialize in Trainer is throwing an error.

  6. #6
    Forum Contributor
    Join Date
    12-27-2012
    Location
    cebu, Philippines
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: userform.show issues

    the error occurs right inside the buttonclick in the logIn userform procedure..
    I wanted the trainer userform to show, only if the user has qualified certain conditions from the logIn userform..

    I do have two instances of the trainer.show method inside the same module, but they are under different "if statements"

    I tried loading the trainer userform from the excel VBE directly by pressing F5, it loads the userform properly..

  7. #7
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Ontario Canada
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: userform.show issues

    Have you tried putting the break point like I mentioned before?

  8. #8
    Forum Contributor
    Join Date
    12-27-2012
    Location
    cebu, Philippines
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: userform.show issues

    the file is not with me right now,
    but i'm certain that it ran well several times before it started acting like that..

  9. #9
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Ontario Canada
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: userform.show issues

    Try the break point and see what happens when you step into the trainer.show
    It is a very good tool for picking out errors in your code because you can check exactly where it is failing.

  10. #10
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: userform.show issues

    HI I dont know if this is completely silly. But when i load my userform they normally have a number. And i guess if you have 4 userforms, they have a number from 1 to 4. This is my code to load userform1 with a Button.

    Please Login or Register  to view this content.
    And i guess you then have to change the number from1 to 2 to load userform 2.

    maybe i just misunderstand it.

    Sincerely

    Abjac
    Last edited by abjac; 03-30-2013 at 11:18 PM.

  11. #11
    Forum Contributor
    Join Date
    12-27-2012
    Location
    cebu, Philippines
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: userform.show issues

    you can modify them and change its name including its caption... on your VBE, if you don't see the properties window, click F4 to see the properties window..

  12. #12
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: userform.show issues

    Yes i know that. I just saw your code the first one without any number. So was just thinking it maybe was a little mistake like this. Maybe you should upload a sample with the error, would maybe be more easy to see, whats not working, and then correct it.
    And this seems to be a little but maybe tricky error. So more easy to see on a sample

    Abjac
    Last edited by abjac; 03-30-2013 at 11:32 PM.

  13. #13
    Forum Contributor
    Join Date
    12-27-2012
    Location
    cebu, Philippines
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: userform.show issues

    oh.. the code at the first post... LOL.. yeah...
    I meant when I had it on the VBE userform is trainer...

    the post was just an example, not the actual code, since I don't have the file right now..

  14. #14
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: userform.show issues

    OK Ag. The problem seems still not so big, if its called trainer or userform, and i guess its just a little thing to correct. But will be more easy to see one a sample, to avoid misunderstandings. But have a look and when you have it upload it here.

    Cheers

    Abjac

+ 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