display true text instead of option value on continous form

G

Guest

I have a table - TableA and a form FormA. I have opted the use the option
group(s) on Form A for ease of data entry. The option group is bound to a
field in TableA. I am creating a second form FormB (a continuous form) and I
would like to display the true text instead of the option value. I tried
creating a textbox and trying this expression on most of the events(on
textbox) with no luck ..

If [LTCResident] = 0 Then [Text12] = "don't know"
ElseIf [LTCResident] = 1 Then [Text12] = "Yes"
ElseIf [LTCResident] = 2 Then [Text12] = "No"
End If

However if I use this expression on the "control source" property of [Text12]
=IIf([LTCResident] = 1, "Yes", "No")
this works if there are only 2 options. Problem is I have option groups
with more than 2 values. PLEASE help. I'd appreciate other ways to do this.
 
R

ruralguy via AccessMonster.com

Take a look at the Choose() function.
I have a table - TableA and a form FormA. I have opted the use the option
group(s) on Form A for ease of data entry. The option group is bound to a
field in TableA. I am creating a second form FormB (a continuous form) and I
would like to display the true text instead of the option value. I tried
creating a textbox and trying this expression on most of the events(on
textbox) with no luck ..

If [LTCResident] = 0 Then [Text12] = "don't know"
ElseIf [LTCResident] = 1 Then [Text12] = "Yes"
ElseIf [LTCResident] = 2 Then [Text12] = "No"
End If

However if I use this expression on the "control source" property of [Text12]
=IIf([LTCResident] = 1, "Yes", "No")
this works if there are only 2 options. Problem is I have option groups
with more than 2 values. PLEASE help. I'd appreciate other ways to do this.
 
G

Guest

it worked ... thank you so much

ruralguy via AccessMonster.com said:
Take a look at the Choose() function.
I have a table - TableA and a form FormA. I have opted the use the option
group(s) on Form A for ease of data entry. The option group is bound to a
field in TableA. I am creating a second form FormB (a continuous form) and I
would like to display the true text instead of the option value. I tried
creating a textbox and trying this expression on most of the events(on
textbox) with no luck ..

If [LTCResident] = 0 Then [Text12] = "don't know"
ElseIf [LTCResident] = 1 Then [Text12] = "Yes"
ElseIf [LTCResident] = 2 Then [Text12] = "No"
End If

However if I use this expression on the "control source" property of [Text12]
=IIf([LTCResident] = 1, "Yes", "No")
this works if there are only 2 options. Problem is I have option groups
with more than 2 values. PLEASE help. I'd appreciate other ways to do this.
 

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