You need an extra relationship for your details portal. This will also require a second table occurrence of InvoiceDetails.
- Open Manage | Database | Relationships
- Click on InvoiceDetails to select it, then click the button with two green plus signs to make a new table occurrence for this table
- You can rename this box, SelectedInvoice.
- Define a new field ( I usually make it a global field ) in Customers, as gSelectedInvoiceID
- Create this relationship: Customers::gSelectedInvoiceID = SelectedInvoice::InvoiceID fk
- Write a one line script: SetField [Customers::gSelectedInvoiceId ; Invoices::InvoiceID ]
- Now you can either put a button in the portal row, or select all the fields in the portal and use button setup to make them a button. Set this button to perform the above script.
- As a final touch, you can use Customers::gSelectedInvoiceID = Invoices::InvoiceID in a conditional format to specify a fill color for the fields in your Invoices portal so that the row of the selected invoice in your Invoices portal will highlight to show you which one is currently selected.
If "Table Occurrence" is a new term, you might want to read this article: Tutorial: What are Table Occurrences?
Excellent. Thanks so much.