Option Group to text

  • Thread starter Thread starter eschlep via AccessMonster.com
  • Start date Start date
E

eschlep via AccessMonster.com

I would like to have an option group with yes/no buttons in a form. I would
then like the report linked to the form show yes no or not be visible if
nothing is selected. How would i do this. THanks
 
Here are my assumptions: The report looks at the form, not a table or query.
I used the name "OPT_NM" for the name of the option group with the value of
'Yes' set to 1 and 'No' set to 2. The form is called 'FormNm' Change the
following based on how you set up your form.

Put a text box on the report with the following in the control source:
=IIf([Forms]![FormNm]![OPT_NM] Is Null,"",IIf([Forms]![FormNm]![OPT_NM]=1,
"Yes","No"))
 
Eschlep,

Do you mean:
- the Option Group is bound to a field in a table, and the selection
in the Option Group is storing a value in the field, and the report is
based on a query that uses this same table?
- the Option Group is an unbound control on the form, used for some
sort of reference purely for the purpose of defining a value to be shown
on the report?

Either way, let's suppose the value of "yes" is 1 and "no" is 2.

Well, I would put a calculated field in the query that the report is
based on. In the first above scenario, this would use the value of the
field that the Option Group relates to (YourField in the example), and
it would look like this...
YourYesNo: Choose([YourField],"yes","no")
In the second above scenario, this would use the value of the of the
Option Group on the form, and it would look like this...
YourYesNo: Choose([Forms]![FormName]![YourOptionGroup],"yes","no")
Then just put a textbox on the report bound to the YourYesNo field in
the query.
 
Back
Top