Option Group values converted to Text String values in reports

F

Fons Ponsioen

Hi.
I guess you need to conver these for a report or Form?
The easiest may be:
=IIF (OptionValue = 1,"Hardware",IIF(OptionValue =
2,"Software","Other"))
all of this on one line.
Hope this helps.
Fons
-----Original Message-----
I have several option groups in my database that I need
to convert the stored numeric values to the Text they
represent in the reports I write. Example: Option Value
(1) = Hardware, Option Value (2) = Software, OPtion Value
(3) = Other
 
G

Guest

I placed the line in the control source of the Option Group's field but it only prints out Other. The field's results are only 2 options (Hardware or Software) I used Other in the example in case some of my groups contain more than just 2 options
When I removed the reference to Other from the expression The report printed nothing

I also noticed ther was not an Iff before the Other. I think I'm missing the boat somewhere.
 
F

Fons Ponsioen

The following line is correct.
=IIF (OptionValue = 1,"Hardware",IIF(OptionValue =
2,"Software","Other"))
All on one line.
I suspect that your "OptionValue" may not be a numeric
value but rather a text entry. If so you may want to try:
=IIF (OptionValue = "1","Hardware",IIF(OptionValue =
"2","Software","Other")).
(with quotes around the 1 and the 2 just as shown.
Give this a try.
Hope it helps.
Fons
-----Original Message-----
I placed the line in the control source of the Option
Group's field but it only prints out Other. The field's
results are only 2 options (Hardware or Software) I used
Other in the example in case some of my groups contain
more than just 2 options.
When I removed the reference to Other from the expression The report printed nothing.

I also noticed ther was not an Iff before the Other. I
think I'm missing the boat somewhere.
I guess you need to conver these for a report or Form?
The easiest may be:
=IIF (OptionValue = 1,"Hardware",IIF(OptionValue =
2,"Software","Other"))
all of this on one line.
Hope this helps.
Fons
-----Original Message-----
I have several option groups in my database that I need
to convert the stored numeric values to the Text they
represent in the reports I write. Example: Option Value
(1) = Hardware, Option Value (2) = Software, OPtion Value
(3) = Other
 
D

Duane Hookom

If the values are consecutive, low numeric values (ie 1,2,3,..) then
consider using the Choose() function
=Choose([FieldValue],"Hardware", "Software", "Other")
 

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

Top