Opening Form from itsself (recursive opening)

  • Thread starter Thread starter Holger Wunderlich
  • Start date Start date
H

Holger Wunderlich

Hello,
I have a problem I cannot solve:

I have an open form A and from this form I have to open the same form A again.

The result should be, that there are two forms A open.

(They are not really equal, because in the record-source is set via openargs and
source-code)

The normal docmd.openform A... doesn't work.
set newForm = new application.forms(A) doesn't work either.


Thank you for reading and answering

Holger Wunderlich
 
Holger Wunderlich said:
Hello,
I have a problem I cannot solve:

I have an open form A and from this form I have to open the same form A again.

The result should be, that there are two forms A open.

(They are not really equal, because in the record-source is set via openargs and
source-code)

The normal docmd.openform A... doesn't work.
set newForm = new application.forms(A) doesn't work either.

At the module level...
Dim NewFrmA As New Form_FormA

Sub SomeEventProcedureInModule
NewFrmA Visible = True
End Sub
 
That's it... Thank you very much!!
I've modified the code a little, so that you can open more than one window
(don't now if I need that, but who knows??)

At the module level...
Dim NewFrmA As New Form_FormA

Sub SomeEventProcedureInModule
set newFrmA = new Form_FormA
NewFrmA Visible = True
End Sub

My fault was that the definition of the variable was done within the procedure,
so the form was closed with leaving the procedure.

Greetings
Holger Wunderlich

Rick Brandt schrieb in der letzten eMail von 13.08.2003 14:36:
 
Now I tried to implement it in my program, but I found another problem:

I cannot pass any arguments to the new form (via code) it's opened with the same
openArgs as the previously opened form.

Any idea, how I can change the openArgs??

Thank you
Holger

Holger Wunderlich schrieb in der letzten eMail von 13.08.2003 23:51:
 
hmmm -- looks as though this cannot be done. So -- try something like
this:
In the 2nd form (the one that is opened from the 1st form) implement a
Property Set. In the 1st form, after making a new instance of the 2nd
form, call the Property set to pass what would normally be done via
OpenArgs. Instead of responding to the value of OpenArgs in the forms
Open method, you will need to do similar functionality in the Property
set. Do all this before making the 2nd form visible.
Please reply back as to whether this works or not ( i have NOT tested
any of this; it is merely a (somewhat) educated guess).
P.S. YOur namesake, Fritz, despite his unfortunate early demise, graces
my music collection with many fine performances.
-=-=-=-=
 
Hello,
thank you for this tip.
I haven't implemented it yet because of some higher-priority problems. But it
sounds very good and I think this will work.

(The implementation of this tip will be delayed till mid-october, so I cannot
say anything more)

Holger

jfp schrieb in der letzten eMail von 21.08.2003 06:02:
 
Back
Top