As others said, the load event fires first and even before that, the DE 
instantiates first.

Here is a trick I use if I need to pass cursors,objects and properties to a 
form with a private data session:

In the calling event of the first form I create an XML cursor thus:

local oXML,cXML
select mycursor

oXML = Createobject("XMLAdapter")
oXML.AddTableSchema('mycursor')
oXML.ToXML("cXML")

DO Form "fmova.SCX" WITH 'acp_vu1', thisform.oData,cXML

In the above manner you pass the object, the variable (acp_vul) and a cursor 
(as xml)

In the receiving form's INIT event you would have code like this:

lparameters pAcp_vul,poData,pcXML

this.addproperty('acp_vul')
this.acp_vul     =  pAcp_vul             && now your passed property is 
available at the form's level

this.addproperty('oData')
this.oData       =  poData                  && now your object is in the 
called form

xmltocursor(pcXML,'newcursor',4)  && now you have the cursor in your called 
form

With the above technique you do not need to fool around with the DE and 
because the called form has a private data session, you do not interfere 
with the data in the calling form; the only care you should have is to close 
the open cursor in the unload or destroy events of the called form.

Hope this helps

Rafael Copquin


----- Original Message ----- 
From: Andy Davies
To: [EMAIL PROTECTED]
Sent: Thursday, April 05, 2007 6:36 AM
Subject: passing parms to a modal form

I'm sure I've done this dozens of times but can't get this one to work:
in the rightclick() of a [main] form I have:
DO Form "fmova.SCX" WITH 'acp_vu1', thisform.oData

fMova is a modal form, it has a de which only has code in afterclosetables
I put the data logic in form.load and it didn't work, debugger showed
form.init being called followed by the form objects inits (which need a
cursor open) - so I moved the data logic to the init BUT the parameters are
not being passed.
Help! says parms are passed to the load of a modal form but load wasn't
being called [yet?]
So where do I pick up the parms?

Andrew Davies MBCS CITP
- AndyD 8-)#


**********************************************************************

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. 
If you have received this email in error please notify the system manager.

This footnote also confirms that this email message has been swept by 
MIMEsweeper for the presence of computer viruses.

Please contact [EMAIL PROTECTED] with any queries.

**********************************************************************



[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to