Getting value from list box

Creating and using forms
Post Reply
Ricardo33
Posts: 3
Joined: Fri Feb 01, 2008 7:33 pm

Getting value from list box

Post by Ricardo33 »

Hello,

I'm looking to extract the value of a list box on openoffice 2.2.

In my database, I have a table name City_List and that table has two columns: Code and City. I would like to use a text zone as indicator, to show the name of the city corresponding to the area code. As for example, there's a part of my table:

Code City
416 Toronto
514 Montreal
613 Kingston

A list box named ''Choosen_Code'' is showing the content of the column ''Code''. In the field ''Content'' of the ''Data'' tab of the text zone, I have written the following code:
SELECT City FROM City_List WHERE Code=514

The text zone shows Montreal... But now I would like to show the city corresponding to the value of the list box... in other language, I would have written:
SELECT Description FROM Ingredients WHERE Code=Choosen_Code.Value

But it doesn't work...

Any help would be appreciated...

Thanks a lot,
Ricardo

p.s.: I've started from installing MySQL on QNX (Unix), linked my Database with open office by of JDBC driver and now I can't move on cause I can't get the value of a list box... I can't believe it doesn't exist... I've looked for List Box options (get value, get position, get number of items,...) but couldn't find some.
Post Reply