What shown in combobox

pm4698

Registered User.
Local time
Today, 04:08
Joined
Jan 23, 2010
Messages
72
Hello there.

I have created a combobox that reads from a query. This query shows 4 fields from a table.

All i want, is when i choose a selection from the combobox, to show me both 4 columns (the whole row).

How can i do this?

Thanks in advance
 
You can have more than one column displayed in a combo box just set the column count to 4 and the column widths to whatever size suits you.

David
 
Whilst it is possible to display more than one column in a combo box, when the drop down list is visible. Only the first visible column will be visible once a selection has been made. To show the additional, related, data you will need an unbound text box for each of the additional columns. In those text boxes put the following;
Code:
=ComboName.Column([B]X[/B])
Where X is the column number containing the info you wish to display. Remember that the columns in a combo box are zero index ie. the first column (usually the hidden index column) is column number zero, and all further columns are number from there up.
 
Thank you all very much!
It really worked!
 
An alternate approach, to actually show all four fields in the combobox after the selection is made, would be to have a calculated field in your Query that concatenates the four fields:

FieldToShow:[Field1] & " " & [Field2] & " " & [Field3] & " " & [Field4]

Now simply use the calculated field FieldToShow as the first field in the combobox and all four fields will appear after the selection is made.
 
An alternate approach, to actually show all four fields in the combobox after the selection is made, would be to have a calculated field in your Query that concatenates the four fields:

FieldToShow:[Field1] & " " & [Field2] & " " & [Field3] & " " & [Field4]

Now simply use the calculated field FieldToShow as the first field in the combobox and all four fields will appear after the selection is made.


note that you can achieve this in a slick manner by making

a) the bound field width 0 (default)
b) column 1 (defined in the query as missinqlinq suggests) width 0.001 - so its effectively hidden within the drop down

since a combo box actually displays the first non-zero width column.
 

Users who are viewing this thread

Back
Top Bottom