Hi Severin,

Before answering the original question, let me ask the following:

Sure your data structure, ehm, does make sense? :)

I mean, obviously "function" is composing a m-n-relationship between
"function_type" and "organization", means there can be multiple
organizations having the same function_type, and the same organization
can have different function_types.

On the other hand, the function_type_id column in "organization"
suggests a 1-n-relationship between "function_type" and "orgnization",
means that every organization does have exactly one function_type, but
there still are multiple organizations having the same function_type.

Those two things seem to contradict each other. So, again: Are you sure
the data structure *really* models what you want? Perhaps you should
describe what you're trying to achieve.

> [dynamic listbox content]
> I need something like "SELECT name, id FROM organization WHERE 
> function_type_id = <value_of_the_first_column_which_is_the_function_type_id>"

Changing the content of a listbox, which is filled from a select
statement, is, well, non-trivial, but perhaps possible - with scripting.

As a rough idea, you need to listen for changes in the selection of the
first list box, create a new SQL statement respecting the new value, and
set it as list source at the second list box. This should automatically
rebuild the list.

Reacting on the change in the list selection is the difficult part,
since as long as you don't leave the control, the value is not yet
propagated to the form, but only part of the control (read the
Developer's Guide about forms to understand the difference, and to see
when control values are committed to where :).

You should be able to get the grid control (*not* the grid control
model), obtain it's "column control" (*not* the column model), and
listen for the proper event, which is fired every time the selection
changes.

Not sure at the moment whether this can be done programmatically only.
It might be (I didn't try) that "Item status changed", in the properties
of the list box column is the event you need to add a macro to.


If you can confirm that your data structure is what you need :), and
tell us what you already did, what worked, and what didn't, we could go
into detail :)

Ciao
Frank

-- 
- Frank Sch�nheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems, Inc.                http://www.sun.com/staroffice -
- OpenOffice.org Database Access            http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to