>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
I think that the problem is with your clkView variable. The form gets created and can be referenced by the variable first time round, but as soon as the click code finishes, the variable clkView no longer exists.
Assign the reference to a new property of the form e.g.
do form clkview with this.value
THISFORM.ClkForm = ClkView
Then check if the propert is a valid object in your fist IF.