Ask Your Question

How to make a ComboBox map like a ListBox?

asked 2015-10-19 05:53:04 +0200

anonymous23423 gravatar image

updated 2015-10-20 13:18:51 +0200

Alex Kemp gravatar image

I'm using LibreOffice 5, with Windows 8.1.

I'm having a problem creating a form with LibreOffice's Database. I want my ComboBox to have the same capibility as a ListBox.

Specifically, I want to create a selection list from a name field from another table and upon selection of this name field, return the corresponding primary key and place it into an ID-pointer of a record field that i'm currently populating in a different table.

I realize i can do this with a ListBox. But, I want to do this with a ComboBox because the ComboBox works better. it lets me type part of the String and have the list jump to the nearest record without needings to scroll through a huge list of elements as with the ListBox.

So I'm wondering. Is it possible to emulate the Translation capiblity of the ListBox in a Combobox by writing a macro? Another angle, is it possible to make the ListBox act like a textbox/combobox by setting a control property. (Note, I already know about dropdown property. What I want is it to behave llike a TextBox and allow me to look up the name field by typing the string and then translate it into the id field.)

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2016-03-20 21:18:45 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Create a ListBox and double click to open it's properties. Then set the Dropdown option to Yes to make it act like a ComboBox. Have fun!

edit flag offensive delete link more

answered 2015-10-20 06:14:17 +0200

doug gravatar image

The LO combo box does not work like that. It would be nice, but the ComboBox list is just one column whereas the ListBox can bind to a second column. What you have in mind would be a big-time kludge for the ComboBox, not easy or straightforward to do.

How would you do it? Probably you would hide a second control on the page storing the index value, which you would look up using Basic SQL query calls triggering on updates to the ComboBox. It would be challenging to ensure consistent and reliable operation of the form, and also because the lookup is going backwards from the description to the key, you would need to work extra hard to maintain data integrity.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-10-19 05:53:04 +0200

Seen: 426 times

Last updated: Mar 20 '16