[Solved] Sql Combo Box info needed

Creating and using forms

[Solved] Sql Combo Box info needed

Postby widowmaker » Fri Jun 05, 2020 4:06 pm

I would like to get some feedback on if it is possible to create a sql statement that I could use in a form to create a combo box that would display data from a
table named “Inventory” containing 3 fields. The field names are
“InvID”,
“Code” and
“ItemName”.

I would then like to be able to click on ONE Item in the “code” field
and have the “InvID” for that selection placed into a
“ItemID” field located in a subform or master form linked to a “Order” table.

Thank You
Last edited by widowmaker on Wed Jun 10, 2020 2:11 pm, edited 1 time in total.
LibreOffice 6.0.7.3 on Linux Mint 19.3
widowmaker
 
Posts: 21
Joined: Mon Apr 27, 2020 10:51 pm

Re: Sql Combo Box info needed

Postby Villeroy » Fri Jun 05, 2020 5:11 pm

This is what a list box does. A combo box is just an ordinary text box plus auto-complete.

Data properties for a working list box
Linked field: ItemID [the column where we write to]
Command type: SQL
Command: SELECT "code", "InvID" FROM "Other Table" ORDER BY "code" ASC [first field is visible, second field is written to linked field]
Bound field: 1 [which is the index of the second one, the first field has index 0]

If you need many similar list boxes like this, you may save the SQL as a query and refer to that query. The result is the same but easier to repeat.
The first field can also be a concatenation such as "Surname" || ' ' || "Forename"
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 28431
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Sql Combo Box info needed

Postby widowmaker » Sat Jun 06, 2020 12:57 am

widowmaker wrote:
I would then like to be able to click on ONE Item in the “code” field
and have the “InvID” for that selection placed into a
“ItemID” field located in a subform or master form linked to a “Order” table.

Thank You


This project is for a handicapped person that can only use one hand, so it is vital that I come up with a combo or list box that will make it possible for a user to enter data by simply clicking a mouse button in a drop down list. I have built list and combo boxes in Access, but since that is not an option for person I am building this for, any info on how to do this would be greatly appreciated.
Thanks
LibreOffice 6.0.7.3 on Linux Mint 19.3
widowmaker
 
Posts: 21
Joined: Mon Apr 27, 2020 10:51 pm

Re: Sql Combo Box info needed

Postby UnklDonald418 » Sat Jun 06, 2020 3:19 am

Look at this example
[Example] Invoice Forms (without macros)
Here are some other resources that might you find helpful
A tutorial Combo vs List Box
and another example Cascading list boxes with and without macros
Then if you have any specific questions we can try to help you from there.
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.6 & LibreOffice 6.1.5.2 - Windows 10 Professional
UnklDonald418
Volunteer
 
Posts: 1322
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Sql Combo Box info needed

Postby Villeroy » Sat Jun 06, 2020 5:23 am

The handling is the same. The functionality is different. Both, listbox and combo, come in two different appearances with or without drop-down button. The attachment is a mockup demonstrating two listboxes and two combo boxes.
Attachments
ListCombo_Mockup.odt
(16.05 KiB) Downloaded 19 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 28431
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany


Return to Forms

Who is online

Users browsing this forum: No registered users and 1 guest