[Solved] ListBox inside a table

Creating a macro - Writing a Script - Using the API

[Solved] ListBox inside a table

Postby dionisio77 » Fri Mar 15, 2019 3:01 pm

Hello, I'm new at OpenOffice.
I'm working with Writer, I have a table. Inside that table I have 2 ListBoxes A and B.
I want to populate the ListBox B based on the selected item of ListBox A.

The problem that I have is that i'm not able to get the ListBox control in the code inside the macro
Last edited by dionisio77 on Mon Mar 18, 2019 2:14 pm, edited 1 time in total.
Openoffice 4.1.2 on Windows 7
dionisio77
 
Posts: 3
Joined: Fri Mar 15, 2019 2:54 pm

Re: ListBox inside a table

Postby Villeroy » Fri Mar 15, 2019 6:36 pm

Base does not have any "lookup fields" like MS Access. Base tables and queries show raw data. List boxes belong to input forms where they are used to represent foreign keys with a visible string and another table's primary key as value. Search this forum for "cascading listbox".
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.x
User avatar
Villeroy
Volunteer
 
Posts: 27301
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: ListBox inside a table

Postby Zizi64 » Fri Mar 15, 2019 7:22 pm

The problem that I have is that i'm not able to get the ListBox control in the code inside the macro

Please upload an ODF type sample file and your macro code here.
Tibor Kovacs, Hungary; LO6.1.6 on Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.3.3; AOO4.1.6
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 8484
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: ListBox inside a table

Postby Zizi64 » Fri Mar 15, 2019 9:16 pm

OpenOffice: 6.0.6.2 on Windows 7

The 6.0.6.2 is not Apache OpenOffice (there is not such version yet). That is LibreOffice. Please update your signature in this forum.
Tibor Kovacs, Hungary; LO6.1.6 on Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.3.3; AOO4.1.6
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 8484
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: ListBox inside a table

Postby JeJe » Fri Mar 15, 2019 11:38 pm

Is the attached file what you're trying to do?
Attachments
listbox example.odt
(11.89 KiB) Downloaded 57 times
Openoffice 4.1.2
Windows 8
JeJe
Volunteer
 
Posts: 613
Joined: Wed Mar 09, 2016 2:40 pm

Re: ListBox inside a table

Postby dionisio77 » Mon Mar 18, 2019 2:11 pm

JeJe wrote:Is the attached file what you're trying to do?


Yes, this is what i want! :super:
I was executing a macro in the lost focus event instead.

Thanks
Openoffice 4.1.2 on Windows 7
dionisio77
 
Posts: 3
Joined: Fri Mar 15, 2019 2:54 pm

Re: [Solved] ListBox inside a table

Postby JeJe » Mon Mar 18, 2019 2:33 pm

The focus events are for when the listbox as a whole loses or gains focus.

Note - the item status changed event will fire when the selection changes - so if you use the up and down arrow keys the item will be copied too.

You could use the Mouse Button Released event... maybe with some code to check if the item has already been copied if you don't want that happening more than once.
Openoffice 4.1.2
Windows 8
JeJe
Volunteer
 
Posts: 613
Joined: Wed Mar 09, 2016 2:40 pm


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 4 guests