Showing one field out of three from a combo box

  • Thread starter Thread starter Joe70
  • Start date Start date
J

Joe70

I have an invoice form which has one field call TYPE which is a combo
box with three choices.
TAXABLE
RESALE
EXEMPT

These also have the same name of the fields on my table. How can I
only have one of them show on the form?
I only want one to show depending on which one was pick form the combo
box. The name of the combo box it TYPE.
Also only one field can have data in it.

Running Access 2003 with one table
 
Hi,


Sounds a design problem.

Rather than

f1, f2, ..., fn, taxable, resale, exempt, ....
Joe, 222, ...., 16.10, null, 2.5%, null, ...


why not


f1, f2, ..., fn, taxType, rate, ....
Joe, 222, ..., 16.10, "resale", 2.5%, ...



It will then be easy to use a simple WHERE clause: WHERE taxType =
"resale".


If you can't have a new design, you can try:


SELECT ..., switch( taxType="taxable", taxable, taxType="resale", resale,
taxType="exempt", exempt) , .... FROM ...



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top