>I have a parent-child form. The child data is displayed in non-grid controls on a pageframe which is itself inside a pageframe. Since the child table is not within a grid, I need a way to navigate the records in the child table. I thought to do this via a dropdown combo with the following code:
>
>** cbo.InteractiveChange
>this.Value = this.value
>select rta_payments
>locate for pmt_id = val(this.Value) and tip_id = tip.tip_id
>select tip
>this.Parent.refresh
>dodefault()
>
>
>This seems to work except when subsequently clicking on the page or any of its controls, I find the child record pointer jumps back to the first child record and does not stay on the one that was selected in the combo. Watching this in the debugger I find that this click triggers a page.activate which contains a page.refresh, but there is nothing there or in any of its controls that would cause a move in the record pointer.
>
>Any thoughts on what might be going on? Or is my approach flawed?
Hard to say exactly what's going on, though you may try to put recno('Child') in the watch window in the debugger and see when it changes.
However, I would use Updateable view for the child table or my latest favorite Cursor Adapter. Thus instead of relations you always would see a subset of data...
If it's not broken, fix it until it is.
My Blog