[Solved] Combo display different than value

Discuss the database features
Post Reply
xcheshirecat
Posts: 2
Joined: Wed Nov 08, 2017 7:30 pm

[Solved] Combo display different than value

Post by xcheshirecat »

Hi, I want my combo or list box to return the id of the user, but display the full name of the user. how do i do that?
Last edited by Hagar Delest on Thu Nov 09, 2017 11:50 pm, edited 1 time in total.
Reason: tagged [Solved].
Open office 4.1.4 on windows 10
UnklDonald418
Volunteer
Posts: 1549
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Combo display different than value

Post by UnklDonald418 »

A Combo Box stores the selected item so what you want is a List Box.
The query used for the data source for the ListBox needs to have the user name in the first column. If you have separate fields for first name/last name then you can use concatenation something like “LastName” || ', ' || “FirstName” AS “Name”
the second column of the query needs to be the user ID field.
List boxes display what is in the first column of the query and store the value in the second column.
It is usually best to define the query directly in the Properties List Box dialog.
On the Data tab change the line Type of list contents to Sql
The List contents line is where the query is entered. You can use the query design GUI by clicking on the ellipsis (…) to the right of the line.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
xcheshirecat
Posts: 2
Joined: Wed Nov 08, 2017 7:30 pm

Re: Combo display different than value

Post by xcheshirecat »

Thanks that thing about the order of the columns wasn't obvious
Open office 4.1.4 on windows 10
Post Reply