>>>Yes, I'm using RI. But the problem is that after I delete a child record, the next record is displayed, but it's not a child of the current parent, but of another parent.
>>>Sylvia
>>
>>I guess the relationship between your parent and child has been broken. Are you using link master on your grid? Or you are using the traditional set up for relationships?
>
>Janet -
>I looked into this a little further to see exactly what the delete action was doing, and it just skips to the next record. So I'm either going to have to write something to tell it to see if the next record is a child of the parent or create a view to limit what is seen.
>Sylvia
There's a nice little kludge, which probably still works. Set Key To [whatever_expression]. If you're not using a view, but some table ordered by parent key, simply
Set Key To ThisForm.ParentKey.Value
on your childtable. Put it in parent key control's LostFocus or something, or the grid refresh (just guessing the proper location).
Pros:
it's easy
Cons:
if you change order of your chld table, you see all the records again;
if you forget to Set Key To (nothing) in the end, you won't see any other records even if you need them;
you have to watch out for other places in your form where you may need to access other records in child table - you won't be able to find them.