Adding child clears parent record 
Author Message
 Adding child clears parent record

I have an update form with a tab containing a browse box for a child file.
On an insert to the parent record, if you select the child tab, insert a
record in the child file, then return to the tab with the parent info, the
information is cleared.

This procedure was created using the wizard. (C5)

Any ideas??



Sun, 15 Apr 2001 03:00:00 GMT  
 Adding child clears parent record
I've got the same problem with CW2.0  My users all click OK or press enter,
then re-select the parent record prior to adding any child records. Such a
pain in the neck that the program doesn't work like I'd expect a good program
to function.  I haven't found the cause or solution yet.  I just wish I
understood the Templates... maybe I could repair the problem myself!!!

Roger

Quote:

> I have an update form with a tab containing a browse box for a child file.
> On an insert to the parent record, if you select the child tab, insert a
> record in the child file, then return to the tab with the parent info, the
> information is cleared.

> This procedure was created using the wizard. (C5)

> Any ideas??



Tue, 17 Apr 2001 03:00:00 GMT  
 Adding child clears parent record
Hi Robert,

I think that this is related with the structure of your table and code
generated with generator. To make myself more clear:

When You add a record to table that doesn't have auto-incremented key(s)
record is written to disk when You press OK button. If You have list box that
updates child file on form for parent file than You should have one key that
is created only to maintain relation between child and parent file, and is
auto-incremented. In that case record will be written in parent file on before
opening the form (because template code must maintain key order for
auto-incremented key). When You add records to child file just prime link
field with value from parent record.

If this is not good enough I'll be happy to send an example to You.

Best regards,
Alexandar

Quote:

> I have an update form with a tab containing a browse box for a child file.
> On an insert to the parent record, if you select the child tab, insert a
> record in the child file, then return to the tab with the parent info, the
> information is cleared.

> This procedure was created using the wizard. (C5)

> Any ideas??



Wed, 18 Apr 2001 03:00:00 GMT  
 Adding child clears parent record
What file driver are you using?


Thu, 19 Apr 2001 03:00:00 GMT  
 Adding child clears parent record

Quote:
>I have an update form with a tab containing a browse box for a child file.
>On an insert to the parent record, if you select the child tab, insert a
>record in the child file, then return to the tab with the parent info, the
>information is cleared.
>This procedure was created using the wizard. (C5)

This is a known bug since ... the middle age of Clarion! It was supposed to
be fixed a long time ago. Apparently not. The workaround now: save the
record buffer before the insert and restore it after.

--



Fri, 20 Apr 2001 03:00:00 GMT  
 Adding child clears parent record
I have exactly the same problem with C4. I solved it thus:

1. Open the data dictionary.
2. Open the child file, then select the key field that links back to
     the parent.
3. Now click in the "Validity Checks" tab, Check if the "Must be in file" is
    set to the parent file. If it is, clear it, then set it to "Cannot be
zero or
    blank".  (So you have some sort of validity check.)

    (Go back to the main dictionary, highlight the file you just fixed, and
     press the browse button, and update it if it asks.)

4. Re-generate the code, for the procedure concerned in the Application
window.

All should now work.

This solution may not be useful if you really need the "Must be in file"
check. However,
I found that when I do the Child file through the generated code, I allready
have the parent key,
and as I dont allow any change of it, there is no chance of a corruption
problem.

Hope this helps, if you have a problem let me know.

Regards

Quote:

>I have an update form with a tab containing a browse box for a child file.
>On an insert to the parent record, if you select the child tab, insert a
>record in the child file, then return to the tab with the parent info, the
>information is cleared.

>This procedure was created using the wizard. (C5)

>Any ideas??



Wed, 02 May 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Add Child Record Within New Parent Record form.

2. Adding child records for a newly inserted parent record (CW2003)

3. SQL - adding child record from parent form

4. Copying grand parent, parent, and child records

5. Adding Child Record to a Child file during Update

6. Parent form cleared when EIP child browse

7. How To restrict child browse to selected parent browse record

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

9. Saving child rec before Parent record, How?

10. Copying autonumbered parent, child, grandchild records...

11. Copying Parent, Child, Grandchild Records...

12. Copying Parent, Child, Grandchild autonumbered records...

 

 
Powered by phpBB® Forum Software