Well, there is already a customer ID associated to the sale or purchase respectively. I don't know why you store another customer ID in the table of part numbers, so I left this out for now. I'm not sure if your database is usable anyway.
How to pass the customer ID from the master form through the intermediate form forward to the data form:Open the forms navigator.
Source of intermediate form:
- Code: Select all Expand viewCollapse view
SELECT "Filter".*, :pCID AS "CID" FROM "Filter" WHERE "FID"=2
Link master field: INT1 (from the master record where FID=1)
Link slave field: pCID (parameter name without the leading colon)
Now the named parameter :pCID which is passed from the parent form appears as another field "CID" in this form's record as you can see when you hit the ellipsis button next to the source field and run the query.
Open the properties of the final form.
Add an additional master-slave link from CID to the data table's customer ID field in addition to the 2 existing links.
The macro setup remains untouched.