Include the value of a form control in a listbox SQL

Creating and using forms
Post Reply
allen1147
Posts: 1
Joined: Sat Mar 26, 2022 5:58 am

Include the value of a form control in a listbox SQL

Post by allen1147 »

I want to refer to the value of a combobox on a form in Base in the where clause of the sql that populates a listbox on the form. Ideally the listbox sql should execute any time the value of the combobox is changed by the user. If that is possible, I would prefer to use the value of multiple comboboxes (at least two) in creating the where clause in the sql for the listbox whenever the value of either of the two comboboxes is changed by the user. I know how to write sql but don't know how to modify the where clause to refer to a control on the form and its value and how to initiate a refresh of the contents of the listbox.
Last edited by MrProgrammer on Sun Mar 27, 2022 4:36 pm, edited 1 time in total.
Reason: Moved topic from Beginners forum to Base → Forms
Allen Wegele OpenOffice ver4.1.11 macOS 11.6.4 Big Sur
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Include the value of a form control in a listbox sql

Post by Villeroy »

It is a major shortcoming that we can't have parameters in listboxes as we have in subforms. If your combobox text is stored in some table, [Base, Python] Tiny Macro Refreshing Forms, List/Combo Boxes can refresh forms and refreshable form controls once a record has been saved or deleted.
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
Post Reply