CW4 Writing to a parent file from child file's update form 
Author Message
 CW4 Writing to a parent file from child file's update form

Hi all,

I've been fumbling around for awhile trying to figure out how write to more
than one file from a form.   In this case, i'm trying to update an employee
file field, NextVac, from its child (Vaccination) update form.

I've tried formulas, i've tried a little source code (a very little bit <g>),
i've tried using local and global variables to "hand-off" the value, but i
guess i'm just not getting the logic.

Please hellp - How do i update a single field in a parent record
from the child form.  (I'm fairly sure i've got my keys right b'c when i
insert/change a child record the appropriate parent fields fill-in nicely.)  

Any help appreciated,
Steve



Sun, 08 Oct 2000 03:00:00 GMT  
 CW4 Writing to a parent file from child file's update form

I think the following will work:

In the Files declaration for your form, be sure you have the
following:

        FILES
          |__ Vacation
          |__ Parent

This creates a 'view' containing data from both tables.

Then, the basic method is to:

        When saving the Vacation data, enter code similar to the        
               following in the Accepted embed:

                Parent:NextVac = Vacation:NextVac

                this will assign the value entered for
                           Vacation:NextVac to the related value in    
                           the Parent record

        PUT(the Parent file)

                this will write the Parent record back to the
                Parent table.

Be sure to read up on PUT to insure you get the syntax correct for
your situation.

HTH,

Dean    



Quote:
>Hi all,

>I've been fumbling around for awhile trying to figure out how write to more
>than one file from a form.   In this case, i'm trying to update an employee
>file field, NextVac, from its child (Vaccination) update form.

>I've tried formulas, i've tried a little source code (a very little bit <g>),
>i've tried using local and global variables to "hand-off" the value, but i
>guess i'm just not getting the logic.

>Please hellp - How do i update a single field in a parent record
>from the child form.  (I'm fairly sure i've got my keys right b'c when i
>insert/change a child record the appropriate parent fields fill-in nicely.)  

>Any help appreciated,
>Steve



Mon, 09 Oct 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. I have Update Form (parent file) with Browse List (child file)

2. Updating parent file when child edited

3. Parent/Child/Related File updating

4. Update Parent/Child files

5. Update of Parent Form from Child

6. Update parent value from child form

7. Adding Child Record to a Child file during Update

8. parent-child's child process interaction

9. CW4.0 Gold parent/child synchronization error

10. Reports with One Parent and Two Child files(multiple records eacy)

11. SQL - adding child record from parent form

12. Add Child Record Within New Parent Record form.

 

 
Powered by phpBB® Forum Software