Turn text box into dropdown box on form

Creating and using forms
Locked
Kirjava
Posts: 35
Joined: Sun May 03, 2015 2:58 pm

Turn text box into dropdown box on form

Post by Kirjava »

I did it before but I can't remember how.
I have a form set up with text boxes, but I wanted to turn them into a dropdown list to minimise spelling mistakes.

I tried Replace with > List box, but it doesn't work. It just makes the box unresponsive.
Replace with > Combo Box puts a line along the bottom of the text box, and also makes it unresponsive.

Summary:
I already have a table.
I already have a form.
The purpose of the form is to add new items to the table
The form was made with the wizard.
The form has text boxes on it.
I want to turn some of those text boxes into dropdown boxes.
I want the dropdown box to display one of each input (eg. "Book", "Game", "Film & TV").


Edit: I added a list box and crtl + click to delete a text box, and put the list box where the text box was. It shows a huge list of 1090 items, instead of one of each. No idea how to make it work.
OpenOffice 3.1 on Windows 7
User avatar
Villeroy
Volunteer
Posts: 31355
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How do I turn a text box into a dropdown box on a form?

Post by Villeroy »

Ctrl+RIght-click>Replace with>Combo box
Data properties> Source type:SQL, Source:

Code: Select all

SELECT DISTINCT "column" FROM "table"
The combo box offers the already existing entries.You you can enter new categories any time because a combo box is just a text box with auto-complete.
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
Kirjava
Posts: 35
Joined: Sun May 03, 2015 2:58 pm

Re: How do I turn a text box into a dropdown box on a form?

Post by Kirjava »

It's better, but still not what I want.
I want a box with a list option so that I can add a new item type OR use one which I've already got in the table.
OpenOffice 3.1 on Windows 7
User avatar
RoryOF
Moderator
Posts: 35128
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How do I turn a text box into a dropdown box on a form?

Post by RoryOF »

For information: OpenOffice comes with a built-in set of macros to handle Listboxes: these can be accessed through /Tools /Macros /Organise Macros /OpenOffice Basic /OpenOffice Macros /Tools /Listbox.

Understanding these and their use will require OpenOffice BASIC skills
Apache OpenOffice 4.1.16 on Xubuntu 24.04.3 LTS
User avatar
DiGro
Posts: 210
Joined: Mon Oct 08, 2007 1:31 am
Location: Hoorn NH, The Netherlands

Re: How do I turn a text box into a dropdown box on a form?

Post by DiGro »

Villeroy is right. Check this:
https://www.youtube.com/watch?v=aOkkqaHRgzY
____________
DiGro

AOO 4.1.16 (Dutch) on Windows 11 64-bit. Scanned with Ziggo Safe Online (F-Secure)
Locked