Click to See Complete Forum and Search --> : Multiple Forms In Access


fatbuddha
July 18th, 2001, 05:38 AM
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

Cakkie
July 18th, 2001, 05:58 AM
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
slisse@planetinternet.be

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

fatbuddha
July 18th, 2001, 07:55 AM
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