LibreOffice Base subform displays unrelated records

I would like help solving a problem with a LibreOffice Base subform. I think the subform should be displaying only the records that are related to the record displayed in the parent form. But the subform is actually displaying every record in its data source, regardless of the relationship to the record in the parent form.

The parent form displays a manufacturing work order. It draws data from a query Work Ticket Traveler which consists of fields:

WorkTktRecordNo
Number
Date
ItemID
ItemDescription
DisplayQty
DisplayUOM

The subform displays materials needed. It draws data from a subquery WTT Subform which consists of fields:

WorkTktRecordNo
ComponentNo
ComponentRecordNo
QtyRequired

You can readily see that the link field is WorkTktRecordNo. In the subform properties, the link master field is WorkTktRecordNo and the link slave field is WorkTktRecordNo. So this should cause the subform to display records from the subquery which are related through WorkTktRecordNo.

The only control in the subform is a table control which displays the four fields. This table control is the one with the problem: it displays every record in the subquery.

  • client: LibreOffice 4.1.5.3 (Windows 7 Pro SP1)
  • server: Pervasive PSQL v10 SP2 Workgroup (10.12.16.0), via ODBC (Windows XP SP3)

Is this post of any relevance? I suspect the linking key value does not get passed to a QUERY (you are using for the source) in the FORM filter mechanism, but it does get used to filter a TABLE (or a VIEW). (Not sure about this, though.) Do you have 2 separate tables (i.e. one for WorkTickets and one for Components)?

Setting Analyze SQL command to YES did not change the behavior. I could not make sense of what the other poster was saying about creating “views” where he had queries before, perhaps because I think where the relational model uses the term “view” Base uses the term “query” so to me there is no difference. My parent form and my subform use “Content type: Query” and “Content: (the query name)”. There are no explicit SELECT statements.

Okay I am seeing that Query and View are two different animals. I cannot create a View, which is apparently a true relational view, a server-side query if you will. Pervasive doesn’t support it. So if the linking key value does not get passed to a Query but does get passed to a View or a Table, then my only recourse is to see if I can redesign to use a Table.

So, is your SUBFORM data source QUERY based on the same table as the query for the main (parent) form? NOTE: Base has a CREATE AS VIEW option (right click on the QUERY NAME in the query window) which creates the necessary VIEW. Such a VIEW behaves as a quasi table which you can then choose as the data source for the subform by choosing TABLE (not a query) from the content type drop-down. Can’t see why this wouldn’t work for your setup. So you may NOT need to go to a 2 table re-design?