I have a problem getting records to display that are returned as the result of a query built using <tbl>.query_create(). The query retrieves the correct customer records and displays them for me in an embedded browse on a form OK. But when I try and navigate around the browse and open another modal form that displays the detail of the selected customer on the browse, I get the either the correct customer or the first one in the customer table (which is not in the query result) - it's about 50-50 as to whether or not the correct one is displayed.

As I say, the customer that displays on the modal form is either the correct one or the first one. So here's my form structure.

Form1: Allows me to compose and run my query. Has a "show" button to open form2.

Form2: Displays in an embedded browse the correct customer records resulting from my query. Has a "show" button for form3.

Form3: Displays the details of a customer selected from the browse on form2.

So form3 is the one that displays the wrong customer information.

Here is what I have tried to get the correct customer displayed in form3.

I open form2 via a 'form.view("form2")'. Simple, effective, always displays the correct query result. I have a "customer details button" on form 2. It uses an action script to open form3 using a control on form 2 that contains the customer number. This number is at the parent level of form2, but is also the same customer number of the current customer in the browse. And the control is where the customer number on form2 is equal to the customer number of the table attached to form3.

On form2 I have also have navigation buttons for the embedded browse using parentform:browse1.fetch_first(), parentform:browse1.fetch_last(), parentform:browse1.fetch_next(), parentform:browse1.fetch_prev(). However these buttons also exhibit the same behavior - customer 1 is often displayed instead of the selected one.

Does anyone know how to fix this? Many thanks.