If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Option Group values converted to Text String values in reports
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. . 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 |
#2
|
|||
|
|||
Option Group values converted to Text String values in reports
If the values are consecutive, low numeric values (ie 1,2,3,..) then
consider using the Choose() function =Choose([FieldValue],"Hardware", "Software", "Other") -- Duane Hookom MS Access MVP -- "Fons Ponsioen" wrote in message ... 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. . 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 |
Thread Tools | |
Display Modes | |
|
|