Combo Box and List Box in LibreOffice Base

LibreOffice Base offers two primary list-selection controls for data entry forms: the Combo Box and the List Box. While both controls present users with a list of selectable items to streamline data input and reduce errors, they serve fundamentally different purposes in relational database design. This guide details the features, configurations, and data source options available for both controls in LibreOffice Base.

The Combo Box Control

A Combo Box combines a standard single-line text input field with a drop-down list.

The List Box Control

A List Box restricts the user to selecting only from a predefined set of choices, preventing free-form manual text entry.

Available Data Source Types

Both controls can be populated using several data source types accessible via the Data tab in the control’s Properties dialog:

  1. Valuelist: Static values are entered manually into the control’s properties. Items are separated using Shift+Enter. Best for small, unchanging lists.
  2. Table: Binds the control directly to an entire table in the database.
  3. Query: Uses a saved query from the Base document to populate the list.
  4. SQL: Uses a custom SELECT statement. For List Boxes, this typically follows the format SELECT "DisplayName", "ID" FROM "TableName" where the first column is displayed and the second column is stored (using the Bound field index 1).
  5. SQL [Native]: Executes raw SQL directly bypassing the LibreOffice Base parser.
  6. Tablefields: Dynamically populates the control with the column names of a specified table.

Summary of Differences

Feature Combo Box List Box
Custom User Input Allowed Not Allowed
Value Mapping (Display vs. Store) No (Stores displayed text) Yes (Displays text, stores ID/Key)
Primary Role Data entry shortcut / Autocomplete Relational data integrity / Foreign keys
Selection Type Drop-down only Drop-down or scrollable list