Listbox deactivates itself, bug no bug? I'm a beginner XD

Hi,

i wanted to try base to see if it could be useful for me. I have two tables. In the first I save an ID to the unique-key of the other second table. With this I wanted to have a drop down in the form of the first table, showing me the options according to the second table. This seems to work more or less but for some reason the listbox is always greyed out and I can not view or select my options.

For some strange reason the listbox seems to deacitvate itself. I can however deactivate it, save form , activate it and safe the form and than it works. Unfortunately once I close the form and reopen it … all dropdowns are inactive again.

So this seems to be quite the ugly bug… but maybe I am just doing something wrong? Can someone maybe confirm my observartion.

Running windows 11, 64 bit, Libre Office 7.3.2.2

relations2listboxes.odb (61.6 KB)
is an example database with a one-to-many relation between persons and animals and a many-to-many relation between persons and things. All types of relations are implemented by means of subforms and listboxes. A listbox writes another table’s item-ID (primary key) into form’s foreign key field by selecting some text. For instance, the blue listbox in form document “Persons” shows the animal which is associated to the current records person. When you select some animal name, you actually write the animal’s row ID (primary key of table “Animals”) into the person’s AnimalID field.

Recipe for a working listbox:
Linked field: name of a foreign key
Source type: SQL or Query
Source: SELECT “Text”, “Primary Key” FROM “Other Table” ORDER BY “Text” (or the respective query name for that SELECT statement)
Bound field: 1 (which refers to the second field, the other table’s primary key, the first field has index 0)

Thanks, your example is helpful. I had already done as you did there … it seems the problem was my first table. For some reason I could not edit it directly anymore. I deleted it and made it new and now it all works as it is supposed to.

Base needs a primary key. Otherwise it can’t open a record for editing.