IIF() question...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a form that has a text box that displays whether a system is either a
customer system or a stock system. The value stored in the table is either a
0 or a 1. I would like to have in the form 0=Customer and 1=Stock. I have
tried messing with the IIF() statement in the Control Source.

=IIF ([CustomerStock]=0,"Customer","Stock")

It works fine for putting Customer in the text box, but it doesn't for stock
systems. It keeps putting Customer in the box.

Any help would be sweet.

Thank you.
 
When you open your table in design view, what is the Data Type of the
CustomerStock field?

If Text, try:
=IIF ([CustomerStock]="0","Customer","Stock")

Also, check the Name property of this text box. Make sure it is not the same
name as a field (e.g. it cannot be named CustomerStock.)
 
After messing wth it a little more this is what I came up with that seems to
work the way that I want...

=IIf([CustomerStock]=0,"Customer",IIf([CustomerStock]=1,"Stock","Customer"))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Dlookup turn -1 or 0 into a word 2
Switching text on a command button 7
iif statement 2
error 3075 4
IIF statement 5
Getting rid of a Having clause 1
Calc Sales based on Stock Count 3
IIF statements 2

Back
Top