Field Display in Combo Boxes

  • Thread starter Thread starter Carl J. Hixon
  • Start date Start date
C

Carl J. Hixon

Here's one for everybody...

I have a combobox on a form. I am using a query as the row source. The
query links to a table both display 3 columns (key, grade, tuition). I use
bound column 1 because I only want to store the key in my form record. In
the combo box, I format the columns (0.2", 1",0") so that the grade can be
seen. BUT, once the selection is made the combobox only displays the key
because this is what I have bound. I want to bind the key but show grade
after the selection for user friendliness.

Am I going about this the wrong way?

Thanks,
Carl
 
Set the ColumnWidths Property to 0", 1", 0".

The width of the first column must be zero (0), NOT 0.2 or even 0.001
 
Columns = 2
Dound column = 1
Column widths = 0";2"
In the Query behind add the values together in column 2 IE
Column 1 = [Key]
Column 2 = Display: CStr([Key]) & " " & CStr([Grade]) & " "
CStr(Format([Tuition],"Currency"))
 
The combo box will display the first visible column. If you want to show
both the key and grade in the dropdown list, then reverse the order of the
two fields in the row source query (have grade first, then key, then
tuition), then change the bound column to 2 so that the key is still the
value of the combo box even though grade will show in the box after the
selection is made.

If you don't need the key to show in the dropdown list, then keep the field
order the same, keep the bound column as 1, and change the list widths
property to this:

0"; 1"; 0"
 
Got it! Thanks everybody. I can't believe that I forgot that tidbit of
information!!

Carl
 
Back
Top