Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do i reference a spawned form? - VFP6, SP3
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00244776
Message ID:
00244784
Views:
12
Seems like you need to create a property in form clkview to store your parameter in. Then in the Init of clkview you can receive the parameter passed into a temporary variable and assign it to the form property. You can then reference the property anywhere in the form:

LPARAMETER Temp
THISFORM.MyProperty = Temp

For referencing the form external to the form, check out the NAME clause in the DO FORM command.

Or create the form from a class you've made and reference it thus:

oForm = CREATEOBJECT( "MyForm" )
oForm.MyProperty = Whatever
oForm.Visible = .T.
etc.

Bill

>I have an application where I need to do the following:
>
>There is a grid on the form. If a user double clicks a particular cell, I would like to show a small detail form off to one side.
>In the doubleclick event of the cell, I have a line that says
>do clkview with this.value, where clkview is the form I want to spawn.
>
>Now needless to say, if it exists, the form should be updatable by passing the value to the property on the clkview form that stores the value passed.
>
>Therefore I thought I could reference the form with
>clkview.value=this.value
>clkv.refreshit
>
>Where value = stored value, and refreshit= routine to requery and refresh it.
>
>However what happens, is the object reference does not get created and I cannot reference it this and it spawns another form when the user doulbeclicks. Needless to say this is confussing having all of these windows open, when only one is valid.
>
>The actual doubleclick code snippet is below:
>
>if type('clkview')=='O' and clkview!=.null.
> clkview.tclock=this.value
> clkview.viewrefresh
> clkview.activate
>else
> do form clkview with this.value
>endif
>
>What am I missing?
>
>TIA,
>
>Mike
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Reply
Map
View

Click here to load this message in the networking platform