Option Group Buttons

  • Thread starter Thread starter Sheri Emery
  • Start date Start date
S

Sheri Emery

Hi,
I'm working on putting together a form that is using a
group of Option buttons for Successful, Failed, and Not
Applicable. Access stores the values for the field as 1,
2, and 3 (it doesn't appear as though I can change them to
text values). Is there an expression or something I can
do to have that field return the text response(successful,
failed, and not applicable) instead of the value (1, 2, or
3) on my reports and in my subforms?
Thanks for your help.
 
You could create a calculated textbox that will do this. A calculated
control isn't editable by the user, it just outputs data. Try something
similar to the following in the textbox's Control Source.

=Choose([FieldName], "Successful", "Failed", "Not Applicable")
 
Hi,
I'm working on putting together a form that is using a
group of Option buttons for Successful, Failed, and Not
Applicable. Access stores the values for the field as 1,
2, and 3 (it doesn't appear as though I can change them to
text values). Is there an expression or something I can
do to have that field return the text response(successful,
failed, and not applicable) instead of the value (1, 2, or
3) on my reports and in my subforms?
Thanks for your help.

In addition to the Choose() function suggested by Wayne Morgan, you
can use an IIf() function as control source of an unbound control:

=IIf([FieldName]=1,"Successful",IIf([FieldName]=2,"Failed","Not
Applicable"))

Also, you can use Select Case (in the Report Detail Format event) to
assign the value to an unbound control in the report.

Dim AValue as String
Select Case [ControlName]
Case is = 1
AValue = "Successful"
Case is = 2
AValue = "Failed"
Case Else
AValue = "Not Applicable"
End Select
Me![ControlName] = AValue
 
Back
Top