Home > Archive > dBASE Questions and Answers > October 2006 > working with subforms









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author working with subforms
Bill

2006-10-25, 7:34 am

I am using this code to transfer data to a subform

set procedure to test.wfm additive
f = new testform()
f.open
f.pnumber.value = form.fe2.value
close procedure test.wfm

My question is : how do I move data form the test subform back to a field on
the parent form.



Dan Barbaria

2006-10-25, 7:34 am

Bill,

You testform (subform) code should read something like this:

class testform( oParent, cTitle ) of SUBFORM( oParent, cTitle )

rather than a normal form that reads like this:

class testform of FORM

When you open the testform it should open like this:

f = new testform( name of parent form "testform" )
f.open()

To move data from the test subform to a control on the parent form you would
do something like this:

Parentform.controlName.value = testform.control.value

Dan Barbaria

class webjobsForm( oParent, cTitle ) of SUBFORM( oParent, cTitle )
"Bill" <toquerrio@hotmail.com> wrote in message
news:MdCvOUi8GHA.1684@news-server...
>I am using this code to transfer data to a subform
>
> set procedure to test.wfm additive
> f = new testform()
> f.open
> f.pnumber.value = form.fe2.value
> close procedure test.wfm
>
> My question is : how do I move data form the test subform back to a field
> on the parent form.
>
>
>



Bill

2006-10-25, 7:34 am

What should I replace oParent,cTitle with ?
"Dan Barbaria" <daniel.barbaria at ops.org> wrote in message
news:9WZSwHj8GHA.1684@news-server...
> Bill,
>
> You testform (subform) code should read something like this:
>
> class testform( oParent, cTitle ) of SUBFORM( oParent, cTitle )
>
> rather than a normal form that reads like this:
>
> class testform of FORM
>
> When you open the testform it should open like this:
>
> f = new testform( name of parent form "testform" )
> f.open()
>
> To move data from the test subform to a control on the parent form you
> would do something like this:
>
> Parentform.controlName.value = testform.control.value
>
> Dan Barbaria
>
> class webjobsForm( oParent, cTitle ) of SUBFORM( oParent, cTitle )
> "Bill" <toquerrio@hotmail.com> wrote in message
> news:MdCvOUi8GHA.1684@news-server...
>
>



Dan Barbaria

2006-10-25, 7:34 am



"Bill" <toquerrio@hotmail.com> wrote in message
news:uCGHSXj8GHA.1136@news-server...
> What should I replace oParent,cTitle with ?


In the subform you leave oParent, cTitle as is.

You pass those parameters to the subform before you open it as I showed you:

f = new testform( name of parent form, "testform" )
f.open()

To make it a bit more clear, assume you open the subform with a push button
on the parent form. The code in the parent forms pushbutton on_click event
would go like this:

f= new testform(this.form, "Test Form")
f= open()

In this case this.form is the oParent parameter and "Test ForM" is the
cTitle parameter.

Dan



> "Dan Barbaria" <daniel.barbaria at ops.org> wrote in message
> news:9WZSwHj8GHA.1684@news-server...
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com