Base dropdown country list

I’m trying to create a libreoffice base dropdown list of countries. Is there any recommended way to set this up, or should I just create a table of all possible countries? Or a fixed list somewhere?

IIUC, there’s no single “true” country list. Do you want to include there only countries recognized by your country? or another country? or UN? or … ? So - probably you’d need your own list. (LO does contain its list of locales it supports; and uses ICU to handle that; but no idea if there’s any interface to that from user code, and if that’s an adequate substitute for a generic problem.)

thanks, so I’ve created a list from one I found online, stuck that in a table called “Countries”. I have the Type of List contents set to “Sql” and then the list content set to “Select ‘Name’ from ‘countries’” and the dropdown works fine, but the existing data doesn’t show up in the form …

I tried setting a couple of records’ countries directly, and they have worked, but the rest of the records countries have been deleted … hmmm

MySQL comes with a sample table world.country.

The query should retrieve two fields, one for the list box display and one for the underlying value.

SELECT "Name", "Name" FROM "Countries"

Here is an example file that uses embedded HSQLDB: country of person.odb.

To specify the country for Susan, open the Person form, navigate to the second record and choose a country from the list box.

The example shows two “Country” controls for illustration only; the text box is not needed.

Similar questions can be found at: