Adding child records for a newly inserted parent record (CW2003) 
Author Message
 Adding child records for a newly inserted parent record (CW2003)

If I add a new parent record (but not yet press OK) then click on tab
for child records and add, then when press OK to child record it gives
error message saying that parent ID not found on file.

Only way at the moment is to add master record, press OK which takes
user back to browse, then double click on that record and then add the
child records.  The users hate doing this.  Very unproductive.

What have I done wrong to get this situation?



Sat, 25 Nov 2000 03:00:00 GMT  
 Adding child records for a newly inserted parent record (CW2003)

Hi Rick

I got around this by adding Embed code.  I had the table for the child
file on a tab then embed the code to ADD the master record to the tab
changing embed points.  This works but has a couple of problems.  You must
test for the existence of the master record before adding.  This is sort
of obvious I suppose but I got caught first time because I tested only for
Insert Mode.  This gives an error if the user cycles around the tabs
again.  There is also a little bit of a problem in dealing with the Cancel
button.  Again I can't remember exactly what I did but I had to make sure
that the record and its children were deleted if the user Cancelled from
the main tab after adding children on the back tab.

Hope this helps

Regards

David Pennycuick

Quote:

> If I add a new parent record (but not yet press OK) then click on tab
> for child records and add, then when press OK to child record it gives
> error message saying that parent ID not found on file.

> Only way at the moment is to add master record, press OK which takes
> user back to browse, then double click on that record and then add the
> child records.  The users hate doing this.  Very unproductive.

> What have I done wrong to get this situation?



Sun, 26 Nov 2000 03:00:00 GMT  
 Adding child records for a newly inserted parent record (CW2003)

Rick,
I'm sure that when I pressed insert, the parent record was added to the file
immediately.  The problem I was having was if I added child records and then
cancelled, the child records remained and I had to delete them manually.

I use the browse > form templates with a 1 to many relationship and an
auto-incrementing key field for the parent.  Maybe you are doing something
different?


Quote:

>Hi Rick

>I got around this by adding Embed code.  I had the table for the child
>file on a tab then embed the code to ADD the master record to the tab
>changing embed points.  This works but has a couple of problems.  You must
>test for the existence of the master record before adding.  This is sort
>of obvious I suppose but I got caught first time because I tested only for
>Insert Mode.  This gives an error if the user cycles around the tabs
>again.  There is also a little bit of a problem in dealing with the Cancel
>button.  Again I can't remember exactly what I did but I had to make sure
>that the record and its children were deleted if the user Cancelled from
>the main tab after adding children on the back tab.

>Hope this helps

>Regards

>David Pennycuick


>> If I add a new parent record (but not yet press OK) then click on tab
>> for child records and add, then when press OK to child record it gives
>> error message saying that parent ID not found on file.

>> Only way at the moment is to add master record, press OK which takes
>> user back to browse, then double click on that record and then add the
>> child records.  The users hate doing this.  Very unproductive.

>> What have I done wrong to get this situation?



Thu, 30 Nov 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Add Child Record Within New Parent Record form.

2. SQL - adding child record from parent form

3. Adding child clears parent record

4. Prime record fields on insert - Before adding auto incremented record

5. Copying grand parent, parent, and child records

6. Adding Child Record to a Child file during Update

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