Update Parent/Child files 
Author Message
 Update Parent/Child files

Hi,

Hope to get some help from anyone of you. Using CW2003.

I have a Browse window  with  BrowseUpdate control that calls a form
(to update the ParentFile). Under this  window, there is  a second
browse
box that displays related child records, (ChildFile).

Again, in the ParentFile form, there is a similar browse box (ChildFile)
,
but this one have the browseupdate control for the child.

When the form (ParentFile) is opened for  updating, and  follow
immediately
by opening the form for the child (to update) , I would lose the data
which I
entered earlier for both forms if  I select OK (to save) in the
ChildFile.

There is no problem  if  I save  and  re-open the ParentFile form
before the
updates of the  ChildFile.

ParentFile have one ID field with  unique key  and auto increment.
ChildFile has a prime field with ID from ParentFile.

Is there a  way to update both files simultaneously?

I 'll appreciate it very much if anyone could show me the workaround to
this.

Best regards and a very Happy New Year to all.

Benny Chen



Fri, 16 Jun 2000 03:00:00 GMT  
 Update Parent/Child files

If I understand you right, you are opening up a new parent and from there a
new child.

I don't think the child can be saved to a parent that doesn't exist yet.
Until you save the parent it doesn't exist.
--
Richard A. Higgins
Higginsoft Software


http://www2.digigraf.com/wingroup/rahe/



Quote:
> Hi,

> Hope to get some help from anyone of you. Using CW2003.

> I have a Browse window  with  BrowseUpdate control that calls a form
> (to update the ParentFile). Under this  window, there is  a second
> browse
> box that displays related child records, (ChildFile).

> Again, in the ParentFile form, there is a similar browse box (ChildFile)
> ,
> but this one have the browseupdate control for the child.

> When the form (ParentFile) is opened for  updating, and  follow
> immediately
> by opening the form for the child (to update) , I would lose the data
> which I
> entered earlier for both forms if  I select OK (to save) in the
> ChildFile.

> There is no problem  if  I save  and  re-open the ParentFile form
> before the
> updates of the  ChildFile.

> ParentFile have one ID field with  unique key  and auto increment.
> ChildFile has a prime field with ID from ParentFile.

> Is there a  way to update both files simultaneously?

> I 'll appreciate it very much if anyone could show me the workaround to
> this.

> Best regards and a very Happy New Year to all.

> Benny Chen



Fri, 16 Jun 2000 03:00:00 GMT  
 Update Parent/Child files

Benny,

When I understand your problem correctly, I think it has something to do
with your file-relationship. Check the [files]-button from your
ChildFile-browse and see if the parent-file is connected (in a tree) to the
child. If this is, delete the parent-file there and re-enter it as "other".
Also check you browse and/or ChildFile update form if there are any lookups
done in the parent file. All those things clould mess up the parent-record
in memory, on your Parent-Update form.

Maarten



Sat, 17 Jun 2000 03:00:00 GMT  
 Update Parent/Child files

Benny,

I suspect that your child form is "calling up" a related parent
record. This can happen if you have the parent file in your schematic
for the child update form, e.g.

Child file
  --> Parent file

If you look at the generated source code for the child update form you
will probably find a GET(ParentFile,..) statement that actually causes
the problem. This will GET the parent record that has been saved to
disk at that point, i.e. the record as it was created by the
Primefields routine, where only the key fields have values.

Hope this helps.

Quote:

>Hi,
>Hope to get some help from anyone of you. Using CW2003.
>I have a Browse window  with  BrowseUpdate control that calls a form
>(to update the ParentFile). Under this  window, there is  a second
>browse
>box that displays related child records, (ChildFile).
>Again, in the ParentFile form, there is a similar browse box (ChildFile)
>,
>but this one have the browseupdate control for the child.
>When the form (ParentFile) is opened for  updating, and  follow
>immediately
>by opening the form for the child (to update) , I would lose the data
>which I
>entered earlier for both forms if  I select OK (to save) in the
>ChildFile.
>There is no problem  if  I save  and  re-open the ParentFile form
>before the
>updates of the  ChildFile.
>ParentFile have one ID field with  unique key  and auto increment.
>ChildFile has a prime field with ID from ParentFile.
>Is there a  way to update both files simultaneously?
>I 'll appreciate it very much if anyone could show me the workaround to
>this.
>Best regards and a very Happy New Year to all.
>Benny Chen

----------------------
Jon Waterhouse
Andy Rowe Consultants,
St. John's NF


Tue, 20 Jun 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

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

2. CW4 Writing to a parent file from child file's update form

3. Updating parent file when child edited

4. Parent/Child/Related File updating

5. Probleme for update parents and children

6. View Parent changes made in Child Update

7. Update parent field from child?

8. Update of Parent Form from Child

9. C4 Losing data on update to a child from parent

10. Update parent value from child form

11. Adding Child Record to a Child file during Update

12. Copying grand parent, parent, and child records

 

 
Powered by phpBB® Forum Software