+ Reply to Thread
Results 1 to 11 of 11

How to call/display UserForm from others UserForm

  1. #1
    Forum Contributor
    Join Date
    11-17-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    230

    Wink How to call/display UserForm from others UserForm

    Hi Guys,

    I have 4 UserForm, file attached please.
    UserForm1: to call UserForm 2,3, and 4.
    UserForm2: to call UserForm 1,3, and 4.
    UserForm3: to call UserForm 1,2, and 4.
    UserForm4: to call UserForm 1,2, and 3.
    I used code: userform.Show and Me.Hide.
    The problem is when i call UserForm2 from UserForm1, thats fine, but when i call UserForm3 from UserForm 2 that is shown UserForm1, not UserForm3 (i used code: Me.Hide).
    Can anyone to solved the code, please?
    Thanks in advanced.

    Regards,
    Iqbal
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,009

    Re: How to call/display UserForm from others UserForm

    On UserForm2, you have a button called "Call Form 3." The code to implement that button simply says
    Please Login or Register  to view this content.
    So you display UserForm2, then click the button, then hide UserForm2. Remember, Me refers to the object containing the code. Hence back to UserForm1, which was patiently waiting for you to finish up whatever you were doing with UserForm2.

    If you want UserForm2 to show UserForm3, then you need code that looks like this in UserForm2:
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    11-17-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    230

    Wink Re: How to call/display UserForm from others UserForm

    Hi Jazzer,
    Thanks a lot for your quick response.
    I changed already as your advice, the code in UserForm2 (file attached), and Debug, because Form1 already shown when the commandbutton on sheet1 clicked. As I know we can't repeat the code to call userform from other user form if the UserForm already shown.

    Regards,
    Iqbal
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    11-17-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    230

    Re: How to call/display UserForm from others UserForm

    Guys, can we use case select statement to show/display multiple UserForm?

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: How to call/display UserForm from others UserForm

    Why don't you unload instead or hide?
    If posting code please use code tags, see here.

  6. #6
    Forum Contributor
    Join Date
    11-17-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    230

    Re: How to call/display UserForm from others UserForm

    Hi Norie,
    I was changed by unload instead or hide, and same problem.
    If only 2 UserForm, it will working properly by using this code: Userform(X).Show and UserForm(X).Hide or Unload UserForm(X).
    But if the UserForm more than 2, then it's not working properly (by using: .Show and .Hide or Unload), e.g.: UserForm1: Shown --> then Call UserForm2 ---> then Call UserForm3 ----> If I want to Call UserForm1, the UserForm2 will be shown because the last call was UserForm2.
    I am trying by code If..then..else..but again debug.

    Regards,
    Iqbal
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    11-17-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    230

    Re: How to call/display UserForm from others UserForm

    Hi Guys,
    I have been tried to solve the problem, then finally i got it, please find the file (attached), but....still, another problem has come.
    Below the code I wrote in Module:
    Please Login or Register  to view this content.
    And this code i wrote in CommandButton, just example to call UserForm1 from UserForm2, etc.,:
    Please Login or Register  to view this content.
    The problem is the UserForm will be displayed and staying continuously, i meant if i click 50 times from 4 UserForm, then 50 UserForm will be displayed. You can try by download the file.
    Can anyone to solved this issue please?
    I need 4 UserForm only will be displayed and enable to call/display from each others.

    Regards,
    Iqbal
    Attached Files Attached Files

  8. #8
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: How to call/display UserForm from others UserForm

    or
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  9. #9
    Forum Contributor
    Join Date
    11-17-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    230

    Re: How to call/display UserForm from others UserForm

    John...thank you sooo...much, perfect and simple.
    I'd like to give excellent reputation, but it could not be, there is dialogue "You must spread some Reputation around before giving it to john55 again".
    Linkin Park...cool John, the first i heard the song "The Wall" rearrangement by this group.

    Regards,
    Iqbal

  10. #10
    Forum Contributor
    Join Date
    11-17-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    230

    Re: How to call/display UserForm from others UserForm

    John, I did to add reputation....again thank you John.

  11. #11
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: How to call/display UserForm from others UserForm

    You're welcome! glad I could help you! Thx for rep!
    yeap, you gave me some rep 2 days ago for another thread (command button color...) and the system doesn't allow you to spread rep to the same user even if it's different thread (I am not agree with this precaution measure...but this is another problem!), you need to spread rep to someone else and then come back, thx again!

    Linkin Park! ... last week-Simon & Garfunkel
    Last edited by john55; 12-26-2013 at 09:48 AM.

+ 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. [SOLVED] Open a userform from a userform, but preserve the info in the original userform
    By jfoerch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2013, 02:38 PM
  2. [SOLVED] 1 Userform that searches and display data in another userform
    By Mystojam in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-09-2013, 04:08 PM
  3. call pdf from userform
    By cfinch100 in forum Excel General
    Replies: 0
    Last Post: 12-05-2012, 03:33 PM
  4. [SOLVED] VB Code to Call Userform in Userform
    By Stonesteel15 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 03-22-2012, 04:47 AM
  5. Display a UserForm based on Data selected in another UserForm's ListBox
    By RPhilbin83 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-26-2011, 11:35 AM

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