Hi! I have a dropdown list in C3 which is populated from a SQL query. I need to get the user selected value and I’ve read and read and can’t find the way.
Thanks!
PD: I would preferably avoid macros and any programming in Calc
Hi! I have a dropdown list in C3 which is populated from a SQL query. I need to get the user selected value and I’ve read and read and can’t find the way.
Thanks!
PD: I would preferably avoid macros and any programming in Calc
Macro free data exchange between Base and Calc: Apache OpenOffice Community Forum - [Solved] Using Filter in Calc V3.1 with dates - (View topic)
Edit: OK, you know that already from your other topic. However, it is not possible to read listbox content from a database and write listbox selection to a cell. If this is what you are looking for, you definitively need some macro. A compromize: Save the listbox value to database and let a macro refresh some database range with the listbox value. A filter table like the one I utilized in the sample can do that job.
Read a distinct value “INT1” from a distinct row #2 from a table named “Filter”:
SELECT "INT1","ID" FROM "FIlter" WHERE "ID" = 2
Drag that query anywhere into the spreadsheet.
Bind the listbox to “INT1” of the same record.
Bind the form’s “After record action” to this:
sub refresh_Import1_AfterAction()
ThisComponent.DatabaseRanges.getByName("Import1").refresh()
End Sub
When the listbox record is stored to the filter record the macro will be triggered refreshes the import range and you can refer to the listbox value by INDEX(Import1;2;1)
(row 2, column 1 of Import1).