Query of Table with Combo Box

  • Thread starter Thread starter Jackie Daehler
  • Start date Start date
J

Jackie Daehler

I have a Table with a combo box with 4 selections...
N/A,One,Two,Three. with the Values stored in the table of
0,1,2,3.

The query total values for 0,1,2,3 correctly.

But I want "N/A", "One", "Two", "Three" to show up on the
report for the column headings.

Thank you in advance
 
Jackie

A couple approaches, depending on how you've defined that combo box (and by
the way, if you have used the "lookup" datatype in your table, as your
description suggests, take a look through the tablesdbdesign on the
subject -- you'll find that it is generally held in low regard).

If you have a lookup table defined with the 0,1,2,3 and "N/A", "One", ... as
the values of your two fields, you can join the query you use for your
report to that table to get/display the "N/A", ... values. This is common
relational design.

If you've defined the combo box/lookup as a value list, you'll have to
reconstruct/reconstitute that value list every time you want to use it in a
report. This is one of the down sides of using value lists as sources for
combo boxes. One way to reconstitute it would be to add in code in your
report's OnFormat event that evaluates the value being passed in (i.e.,
0,1,...) and sets the value of an unbound control to the corresponding,
reconstituted display value.

Wouldn't it be easier just to build the lookup table?!

Good luck

Jeff Boyce
<Access MVP>
 
Back
Top