Ask Your Question

base dropdown country list

asked 2017-12-12 11:56:01 +0200

tansaku gravatar image

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?

edit retag flag offensive close merge delete


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.)

Mike Kaganski gravatar imageMike Kaganski ( 2017-12-12 12:03:21 +0200 )edit

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

tansaku gravatar imagetansaku ( 2017-12-12 12:16:26 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2017-12-12 16:17:04 +0200

Jim K gravatar image

updated 2017-12-12 16:57:04 +0200

MySQL comes with a sample table

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.

Person form

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

Similar questions can be found at:

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-12-12 11:56:01 +0200

Seen: 750 times

Last updated: Dec 12 '17