Table Control in Subform is Read Only

I copied the setup from the PowerFilter.odb that Villeroy created. It has a main form with a subform containing a Table Control. Villeroy's table control allows data to be edited but mine doesn't. The ListBox controls I put on the table control act like plain text boxes, not list boxes. I can't find anything in my setup that's different than Villeroy's. I even have a Numeric control and that's not editable either. The record navigation bar at the bottom of the table works, but the "new record" button is disabled.

I'm uploading a copy of my database and hope that somebody will take a look at it and tell me what I did wrong that caused the subform table control to be read-only with text boxes instead of list boxes.

Version: 7.3.2.2 (x64) / LibreOffice Community
Build ID: 49f2b1bff42cfccbd8f788c8dc32c1c309559be0
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL

HFG_FilterForm.odb (841.0 KB)

The subform merges 2 tables in one row set. In order to edit one record, the record has to be a distinct row identified by its primary key within one distinct table.
Add another subform so the filter table filters one table in a subform and a sub-subform shows the related item(s) belonging to the subform.

Thanks for the quick reply. I will correct the missing PrimaryKey but need to think about the sub-subform. I’ll need a little time for that, but will get back to you soon.

https://ask.libreoffice.org/uploads/short-url/lI5PzUZiuE00EHzjr0sytsNo0l3.odb is another demo database about persons having one animal and multiple things. Each form document has one main form, a subform and a sub-subform.
You can edit the things belonging to a person and the person’s animal. You can edit the persons belonging to a thing and his/her animal. You can edit the persons of an animal and his/her things.

Thanks for the additional subform and sub-subform example. I’m going to build my form using your technique. You’ve helped me again.

One more remark on topic line “Table Control in Subform is Read Only”. A table control is a different visual representation for a bundle of form controls. The table control itself has no data properties, no binding to any data. Each of its columns is a text box, listbox, numeric field, check box, date control etc. When one of these bound controls is part of a table control, there are multiple instances of the same bound control, one for each displayed row. In the form navigator window every form represents a record set, each form control shows some value of the current row, when a form control is bundled in a table control, you can see more values than the current row value.

The thing that is read only here is the subform’s record set. If the form is writable (representing one table with its primary key) you may intentionally restrict the entire (sub-)form to be read only. You can also lock any form control for editing, for instance you may want to show some automatic time stamp or auto-ID number without making it editable on the form.

1 Like