by dpark29 » Fri Jan 15, 2016 11:51 pm
If you are new to OpenOffice (as I am) don't think about forms and sub forms like a MS Access developer where you develop separate main and sub forms and then copy/paste the sub form on the main form and then use form properties to create the parent-child (or in OpenOffice terms master-slave) relationship for the sub form. In OpenOffice one uses the Form Navigator to add sub forms to a form.
As mentioned in earlier posts, you add sub forms by selecting the main form (the one at the top of the list) in the Form Navigator. Then right-click and then select New>Form. This action appends a sub form to the main form. In the properties window of the new form on the [General] tab change the default name from “Form” to something more descriptive, on the [Data] tab link the sub form to the table that will contain fields for the sub form, and use the ellipsis control [...] to the right of the “Link master fields” or “Link Slave Fields” to open the Link Fields control that is used create the one-to-many link between the table bound to the master table and sub form table.
Be sure the sub form control is high-lighted in the Form Navigator and then add the fields to the sub form (unlike MS Access you create the sub form right on the main form)
Summary:
1. In Form Navigator click on the top form
2. Right-click, New>Form
3. Open the Properties window of the new sub form
4. Change the name of the sub form on the [General] tab (optional)
5. On the [Data] tab; identify the table to bind to the sub form
6. Use the Link master field ellipsis control to open the Link Fields control and then identify the master-slave fields for the sub form.
7. Add fields to the sub form (to verify that the controls you are adding are from the “child” table, use the Add Field utility at the bottom of the edit screen to see the table and fields linked to the sub form.
You can use this technique to add one or more sub forms to the main form.
OpenOffice 4.01, Windows 7