Option Group Buttons

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.
 
W

Wayne Morgan

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")
 
F

fredg

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
 

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

Top