H
HeislerKurt
I'm trying to code a control source for a text box to concatenate and
handle various possible values. There are three fields I need to
handle:
For example, if the values for the three fields are ...
Person_Relation = "Parent"
Person_Relation_Other = <NULL>
Person_Relation_Type = "Biological"
.... my text box should show:
Parent :Biological;
(The ":" and ";" will be replaced by "(" and ")" but for now it's
easier to use something other than parentheses for testing.)
If instead the values for the three fields are:
Person_Relation = "Other"
Person_Relation_Other = "Neighbor"
Person_Relation_Type = <NULL>
.... my text box should show
Neighbor
This is what I have so far:
=IIf(IsNull([Person_Relation]),"",[Person_Relation] & (" :"+
[Person_Relation_Type] & ";"))
If the person is a Biological Parent, my current code correctly shows:
Parent :Biological;
But of the person is an Other: Neighbor, my current code shows:
Other;
So, if Person_Relation = "Other" I need to figure out how to:
1. Omit Person_Relation & Person_Relation_Type in the string
2. Show the value for Person_Relation_Other
3. Omit the trailing ";"
Any ideas? Been tweaking and tweaking to no avail. Thank you.
handle various possible values. There are three fields I need to
handle:
For example, if the values for the three fields are ...
Person_Relation = "Parent"
Person_Relation_Other = <NULL>
Person_Relation_Type = "Biological"
.... my text box should show:
Parent :Biological;
(The ":" and ";" will be replaced by "(" and ")" but for now it's
easier to use something other than parentheses for testing.)
If instead the values for the three fields are:
Person_Relation = "Other"
Person_Relation_Other = "Neighbor"
Person_Relation_Type = <NULL>
.... my text box should show
Neighbor
This is what I have so far:
=IIf(IsNull([Person_Relation]),"",[Person_Relation] & (" :"+
[Person_Relation_Type] & ";"))
If the person is a Biological Parent, my current code correctly shows:
Parent :Biological;
But of the person is an Other: Neighbor, my current code shows:
Other;
So, if Person_Relation = "Other" I need to figure out how to:
1. Omit Person_Relation & Person_Relation_Type in the string
2. Show the value for Person_Relation_Other
3. Omit the trailing ";"
Any ideas? Been tweaking and tweaking to no avail. Thank you.