CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2000
    Posts
    50

    Multiple Forms In Access

    In Access, how can you open up more than one instance of the same form?
    If I use the code below, the first line of code will open a "MyForm" form, and the second line will just bring "MyForm" into focus, rather than creating a new form:
    DoCmd.OpenForm "MyForm"
    DoCmd.OpenForm "MyForm"


    Many thanks to anyone that can help me find a way to get several of the same dialog to appear.

    Rob


  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Multiple Forms In Access

    This works, but only if the form you are trying to create has it's HasModule property set to True, you don't even have to add a module.

    public frm as Form
    public frm2 as Form

    public Function OpenForms()

    set frm = new Form_frmSomeForm
    frm.Visible = true

    set frm2 = new Form_frmSomeForm
    frm2.Visible = true

    End Function





    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Sep 2000
    Posts
    50

    Re: Multiple Forms In Access

    Thanks - everything is working now. Still taking me a while to get my head around this VB way of working (I want my C++ polymorphic behaviour back...)

    Rob


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

Featured