+ Reply to Thread
Results 1 to 5 of 5

Placing a form inside of a form

  1. #1
    Registered User
    Join Date
    06-16-2005
    Posts
    1

    Placing a form inside of a form

    Does anybody know how to place a form inside of a form in Excel?

    I have one form with buttons that perform "click events". I would like to place another form on (in) this form. Can it be done?

    Thanks

  2. #2
    Jim Cone
    Guest

    Re: Placing a form inside of a form

    pjw,

    You might want to look at the MultiPage control.

    Jim Cone
    San Francisco, USA



    "pjw" <[email protected]> wrote in
    message news:[email protected]...
    Does anybody know how to place a form inside of a form in Excel?
    I have one form with buttons that perform "click events". I would like
    to place another form on (in) this form. Can it be done?
    Thanks
    pjw


  3. #3
    Jennifer
    Guest

    RE: Placing a form inside of a form

    I just did this in my form not 20min. ago (very excited about figuring it
    out.) so let me finally be the one to help.

    In your form create a button that you want the user to push to open the new
    form.
    The code behind this button would look something like this
    Private Sub cmdViewfrmPickInv_Click()
    Unload Me
    frmPickInv.Show False
    End Sub
    Hope this helps! It works great for me. Jennifer
    --
    Though daily learning, I LOVE EXCEL!
    Jennifer


    "pjw" wrote:

    >
    > Does anybody know how to place a form inside of a form in Excel?
    >
    > I have one form with buttons that perform "click events". I would like
    > to place another form on (in) this form. Can it be done?
    >
    > Thanks
    >
    >
    > --
    > pjw
    > ------------------------------------------------------------------------
    > pjw's Profile: http://www.excelforum.com/member.php...o&userid=24394
    > View this thread: http://www.excelforum.com/showthread...hreadid=379972
    >
    >


  4. #4
    Nigel
    Guest

    Re: Placing a form inside of a form

    You can open another form that is postioned over an existing form, in the
    initialize event of the first form use

    Load Userform2

    this makes the controls on userform2 available to your program, but not
    visible or accessile to the user. So you can set values, fill lists etc.,
    and the form sits in memory ready for use. Then when you want the second
    form to be activated use

    Userform2.Show False (False sets the form modeless, in xl97 use -
    Userform2.Show - as all forms are modeless)

    The second form takes focus, the first form controls are no longer active
    yet visible. You should remove the title bar of the second form to prevent
    it being moved relative to the first form (and for aesthetic reasons?).
    When Userform2 is no longer required (to be user accessible) use

    Userform2.Hide

    Controls on both forms can still be accessed programmatically until you
    finally to get rid of them using

    Unload Userform2
    Unload Userform1


    --
    Cheers
    Nigel



    "pjw" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Does anybody know how to place a form inside of a form in Excel?
    >
    > I have one form with buttons that perform "click events". I would like
    > to place another form on (in) this form. Can it be done?
    >
    > Thanks
    >
    >
    > --
    > pjw
    > ------------------------------------------------------------------------
    > pjw's Profile:

    http://www.excelforum.com/member.php...o&userid=24394
    > View this thread: http://www.excelforum.com/showthread...hreadid=379972
    >




  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Pjw,

    If you are asking whether a Form can display a Form inside it, say like a worksheet is displayed in Excel, then the answer is no. A Form a is actually a Dialog Window. This type of Window doesn't support Multiple Document Interface (MDI) or displaying Windows within a Window. This can be done in Visual Basic but not Visual Basic for Applications.

    Jim's suggestion is as a good one if you want to have a single "Form" with one or more"forms" with separate controls and displays . Each "Form" is selected by a tab.

    Jennifer's suggestion will allow you to display an entirely separate form.It is the simpliest to implement and is a flexible solution. I use both. Which one I use depends on what will work best for the user.

    On a side note, you can embed a object into a User Form, such as, an Excel Chart or spreadsheet, or a Word document. However, this a subject best left for a later time, though.

    Hope this answers a few question.

    Sincerely,
    Leith Ross

+ 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