[Solved] Alphabetical Listing in a List box

Creating and using forms
Post Reply
marcbelanger
Posts: 6
Joined: Fri Oct 24, 2008 4:38 pm

[Solved] Alphabetical Listing in a List box

Post by marcbelanger »

Hello,

I have created a dropdown list in a form. It calls data from another table. The data (organization names) is listed in the order the names were listed.
Is it possible to have the listing in alphabetical order?

In other words:
List box: United Nations
Canada

I want the order to be (despite the order that the names were entered)
Canada
United Nations

Any help would be appreciated.

Marc
OOo 3.0.X on MS Windows Vista
QuazzieEvil
Volunteer
Posts: 283
Joined: Tue Dec 04, 2007 6:38 pm
Location: Houston, TX

Re: Alphabetical Listing in a List box

Post by QuazzieEvil »

use SQL as the data source. use the query builder to generate SQL (click on [...] button). in the query builder, select desired sorting as you normally would in a query/view.
marcbelanger
Posts: 6
Joined: Fri Oct 24, 2008 4:38 pm

Re: Alphabetical Listing in a List box

Post by marcbelanger »

Hello,

I do not want to needlessly bother anybody so if there is a guide somewhere on how to alphabetize listings use SQL could somebody point me to it?

Roberto:

I have created a drop down list.

In the properties list box I have put:

Type of list content: sql

List content: SELECT "org_name", "org_name" FROM Organizations

You wrote:

use SQL as the data source. use the query builder to generate SQL (click on [...] button). in the query builder, select desired sorting as you normally would in a query/view.

Are you suggesting that I put some statement (generated by a querty builder?) in the List content box?

I appreciate your help. I'm trying to prepare a lesson plan for a class I'll be teaching in Nairobi next week (I'm a teacher for the UN).

Marc
OOo 3.0.X on MS Windows Vista
User avatar
Villeroy
Volunteer
Posts: 31345
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Alphabetical Listing in a List box

Post by Villeroy »

List content type: SQL
List content: SELECT "org_name" FROM Organizations order by "org_name"
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
marcbelanger
Posts: 6
Joined: Fri Oct 24, 2008 4:38 pm

SOLVED Alphabetical Listing in a List box

Post by marcbelanger »

That was it. Thanks again Villeroy

Marc
OOo 3.0.X on MS Windows Vista
Post Reply