John,
Setting the record source to a SQL statment will only execute that statement on the init of the grid.
Two choices:
1) Create a parameterized view of the child table with a filter:
a_opcusp.custno = ?lcCustNo
When the record is moved in the parent table or whenever you want to show the page containing the child table you will need to requery the view with code like:
LOCAL lcCustNo
lcCustNo = a_arcust.custno
REQUERY('LocalViewAlias')
2) If you're working with tables just set a relationship between the parent and child tables on custno. The child grid will refresh automaticly as you walk through the parent table.
Will
>I have a screen form with a number of pages within a Page Frame. All but one of the pages are fields for the primary table it's set up for. One of the pages is a grid for which I want to display records related to the current file and record from another file.
>
>To do this, I set the record source type to SQL and set the SQL statement (record source) to somelike like "SELECT * FROM a_opcusp WHERE a_opcusp.custno = a_arcust.custno INTO CURSOR temp".
>
>Nopw, I'm not sure if I need the INTO command, but regardless of this, I can only get this to work once -- when I enter the screen. When I skip through the primary file the records showing on the grid stay the same.
>
>What am I doing wrong?
>TIA!