Multiple instances of a form that has a subform

  • Thread starter Thread starter Jose Nuñez
  • Start date Start date
J

Jose Nuñez

Is it possible to open multiple instances of a form which have a subform?

For example, I tried to open multiple instances of the form Orders in the
Northwind database and it was not possible.

Thanks.
Regards.
José Nuñez
Montevideo
 
This is right to work with forms that haven't a subform. But, if the form
has a subform the form is opened and then closed quikly.

Regards.
José Nuñez
Montevideo
 
Is it possible to open multiple instances of a form which have a subform?

I'm wondering if this is the best way to accomplish whatever you're
trying to do; it seems like a complex environment for the user. What
are the form and subform's record sources? Are the different instances
of the form attempting to edit the same records? Might it not be
better to dynamically change the filter or recordsource of a single
form?

John W. Vinson[MVP]
 
Hi,
I can't reproduce that behavior.
I tried it with a form that contains a subform and it works as expected.
The behavior you describe *sounds like* your form variable going out of scope.
Is that possible?
 
I've a simple test on the Microsoft's database sample
("NorthwindReports.mdb").

I write the following simple function:

Public Function MULTIPLE()
Dim FRM01 As Form

Set FRM01 = New Form_Orders
FRM01.SetFocus

End Function

I call this function from a macro. The form is shown just an instant and
it's closed.

Regards.
José Nuñez
 
For example, it is possible that a user is working with an Order form and he
wants to open another Order form to view some information.
This it is also necessary to give to users the posibility to have opened
more than one form in order to compare information.

Regards.
José Nuñez
 
Hi,
Yes, your FRM01 variable is destroyed (it goes out of scope) when the function has completed
and so your form closes.
You have to make it a global variable if you want to use it this way.
 
Hi,
As well, please read the sample code again from the link I posted.
You will see that the form variable is declared in the 'Declarations' section
therefore it stays in scope after the sub or function executes.
 
Back
Top