Results 1 to 10 of 10

Thread: muliple form in one main form ...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    65

    muliple form in one main form ...

    i have a main form and in its main menu i have edited 5 more other forms, when i am opening one form i can see it but the problem is i cant acess to my main menu to open other forms, how can i open multiple forms from one menu keeping each other active.
    for eg: my main form is A, and five other forms are B,C, D, E, F.
    SO to open form B from a ther is no problem, bt when B is active i cant acess to A,C,D,E,F...so i wnt a code with which i can use it, and keep active all the forms and can be able to acess any one .
    any code will be much appreciated.
    this is how i have used the technique to work.....
    Code:
    B.show  ' to open form B
    C.show  'to open C...similarly others from main menu  A

  2. #2
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Re: muliple form in one main form ...

    The only way I could see you wouldn't be able to use form A is if you were using vbModal when calling the other forms

    I'm guessing you are using this syntax
    Code:
    B.Show vbModal
    If you drop vbModal you should have access to the other visible forms in your projects.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: muliple form in one main form ...

    Perhaps you should consider porting this app over to an MDI project.

  4. #4
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: muliple form in one main form ...

    hadi

    What do you mean by "I can't access A C D E F"?

    Are those other forms visually obstructed because form B covers them?
    Or is it some other issue?

    Spoo

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    65

    Re: muliple form in one main form ...

    well i mean that when i open a form B from from the main form i cant use my main menu to open the other forms , i need to close the form B then and only then i can use to open other forms like C or D or E or F .
    and i also tried vbmodal that is what i am using but it is still the same problem.

  6. #6
    Lively Member
    Join Date
    Mar 2007
    Posts
    82

    Re: muliple form in one main form ...

    can you show us some code?

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    65

    Re: muliple form in one main form ...

    Code:
    Private Sub mnusmallperloss_Click()
    SMALL.Show vbModal
    End Sub
    Code:
    Private Sub mnusmper_Click()
    SMPER.Show vbModal
    End Sub
    Code:
    Private Sub mnuloss_Click()
    TLOSS.Show vbModal
    End Sub
    
    Private Sub mnulper_Click()
    LPER.Show vbModal
    End Sub
    
    Private Sub mnunoisep_Click()
    NOISEP.Show vbModal
    End Sub

  8. #8
    Lively Member
    Join Date
    Mar 2007
    Posts
    82

    Re: muliple form in one main form ...

    ok....I'm to tired now to concentrate but i guess someone olready told you earlier not to user vbmodal.....Vbmodal exactly that does..it loads a new form on top af the old one without letting the user the posibility to acces the old one....


    So, do not use vbmodal

  9. #9
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: muliple form in one main form ...

    Quote Originally Posted by MarkT View Post
    The only way I could see you wouldn't be able to use form A is if you were using vbModal when calling the other forms

    I'm guessing you are using this syntax
    Code:
    B.Show vbModal
    If you drop vbModal you should have access to the other visible forms in your projects.
    Mark

    You are a mind reader

    Spoo

  10. #10
    Frenzied Member
    Join Date
    Mar 2009
    Posts
    1,182

    Re: muliple form in one main form ...

    There are a couple of things to note about the show method...

    This makes it so that the form you show must be closed before you can once again access the calling form...
    Code:
    Form2.Show vbModal, Me
    as does this...
    Code:
    Form2.Show vbModal
    but this allows you to access the calling form but will keep the called form on top of the zorder even when the calling form recieves the focus...
    Code:
    Form2.Show vbModeless, Me
    while this
    Code:
    Form2.Show vbModeless
    is the same as this
    Code:
    Form2.Show
    which allows the forms zorder to exchange positions

    Good Luck
    Option Explicit should not be an Option!

Posting Permissions

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



Click Here to Expand Forum to Full Width