Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Option group values displayed as numbers on report

Status
Not open for further replies.

bruch04

Technical User
Mar 12, 2004
9
US
Hi. I have a form with an option group. The values are stored in a table as numbers, and reports generated from the table display the numbers, but I need the options displayed as text, not the default numeric values. How can I do this? Thanks.
 
You can use the Switch function to do this. Use this as an example in your Control Source for the text box. Just update the control name and the text to return.

Code:
=Switch( [Option_Grp_Value]=1,"Bob", [Option_Grp_Value]=1,"Lisa", [Option_Grp_Value]=1,"Andy", [Option_Grp_Value]=1,"Kaylah", [Option_Grp_Value]=1,"Anabelle", [Option_Grp_Value]=1,"Jennifer", [Option_Grp_Value]=1,"Dan", [Option_Grp_Value]=1,"Julie")

This will convert your numeric value to a text value. There are unlimited number of evaluation expressions and return values in the Switch function.

Code:
Switch(expr-1, value-1[, expr-2, value-2 … [, expr-n,value-n]])

Post back if you have any questions.

Bob Scriver
[blue]Want the best answers? See FAQ181-2886[/blue]


 
Another method if the number values are small and contiguous
=Choose([Option_Grp_Value], "Bob", "Lisa", "Andy", "Kaylah", "Anabelle", "Jennifer", "Dan", "Julie")

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top