On 1/31/2010 10:04 PM, Seb wrote:
Hi,
I cannot find how to have a list box showing multiple columns from a
table. This is for a field in a form that is a foreign key (many side)
of the table containing the columns to display. I thought I could do
this by doing "control properties -> data -> type of list contents
[Sql]", and then under "list content" have a SQL statement such as:
SELECT "col1", "col1", "col2", "col3"
with "bound field" set to the default '1'. How should this be done?
Thanks.
Howdy Seb,
Sorry to say you didn't miss anything in your search.
Multiple column display in list is not supported.
You can display 1 field only if you want the display list to contain
data from multiple columns then you must assemble the single text column
in a query:
SELECT "Col1" || ' ' || "Col2" AS "DisplayText", "ForeignKey" FROM...
Which brings up another piece of info.
The list or combo box always displays the first column, the data field
in the target table gets the second column or higher.
Of course you start counting at zero in programming and you should know
that (lol), so in the property editor you set the bound column to 1 or
higher.
Now the above SQL sample is not going to be adequate for real use, you
want to account for nulls, formatting, etc.
Drew
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]