Print the names of the options, not the numbers

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

Guest

How do I manipulate a report so it prints the option chosen, not the code (#)
chosen?
 
I think you are going to have to elaborate on this question as it's not
clear what you are asking.
 
How do I manipulate a report so it prints the option chosen, not the code (#)
chosen?

If you wish to show, in a report, a text value based upon the stored
Option Group number, it's simple enough.

Add an Unbound Control to the report.
Set it's Control source to (if there are, for example, just 3
options):
=IIf([OptionGroupName] = 1,"This Text",IIf([OptionGroupName]= 2,"That
Text",IIf([OptionGroupName] = 3,"Third Text","Nothing Chosen")))

Or... you could use the Choose() function in the Control's Control
Source:
=IIf(IsNull([OptionGroupName]),"Nothing
Selected",Choose([OptionGroupName],"First Text","Second Text","Third
Text","Fourth Text","Fifth Text","etc."))

If you had many more options, then you could use a Select Case
statement in the Repor's Detail Format Event:

Dim strText as String
Select Case OptionGroupName
Case is = 1
strText = "First Text"
Case is = 2
strText = "Second text"
etc.....
Case is = 15
strText = "Fifteenth Text"
Case else
strText = "Nothing Selected"
End Select
[ControlName] = strText
 
Glenda said:
How do I manipulate a report so it prints the option chosen, not the
code (#) chosen?

The data source of the report must have the name of the option included.
If it does not you will need to add it. Once that is done just open the
report in design mode and replace the code# with the field for the name.
 
Thank you so much, that exactly answered my question.
--
Glenda


fredg said:
How do I manipulate a report so it prints the option chosen, not the code (#)
chosen?

If you wish to show, in a report, a text value based upon the stored
Option Group number, it's simple enough.

Add an Unbound Control to the report.
Set it's Control source to (if there are, for example, just 3
options):
=IIf([OptionGroupName] = 1,"This Text",IIf([OptionGroupName]= 2,"That
Text",IIf([OptionGroupName] = 3,"Third Text","Nothing Chosen")))

Or... you could use the Choose() function in the Control's Control
Source:
=IIf(IsNull([OptionGroupName]),"Nothing
Selected",Choose([OptionGroupName],"First Text","Second Text","Third
Text","Fourth Text","Fifth Text","etc."))

If you had many more options, then you could use a Select Case
statement in the Repor's Detail Format Event:

Dim strText as String
Select Case OptionGroupName
Case is = 1
strText = "First Text"
Case is = 2
strText = "Second text"
etc.....
Case is = 15
strText = "Fifteenth Text"
Case else
strText = "Nothing Selected"
End Select
[ControlName] = strText
 

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

Back
Top