concatenating text boxes that contain expressions

D

dlazenby

I am trying to concatenate text boxes that contain different expressions and
am clueless.
My current issue is concatenating the values of 1) an option group with 2) a
field that is setup as a checkbox.
For example FieldA is for the option group. FieldB is for the checkbox.
For my report, my textbox expression with the option group is:
=Choose([FieldA], "breast biopsy", "lumpectomy", "mastectomy", "simple
mastectomy").
my textbox expression for the field with the checkbox is:
=IIf([fieldB],"modifier 59",Null).
My question is how do I make it so that I can concatenate those 2 fields (so
that they are on the same line, with a single space). Ultimately, I may need
to connect 3 or more of these expressions.
It seems like the way to go would be to make it so that the "output/value"
of those expressions becomes a new simple field (each) and then I could use
my old ways of concatenating with the & sign or the + sign. If you can't
tell, I am a novice with structuring expressions and also working with VBA.
Please advise. Thanks.
 
M

Marshall Barton

dlazenby said:
I am trying to concatenate text boxes that contain different expressions and
am clueless.
My current issue is concatenating the values of 1) an option group with 2) a
field that is setup as a checkbox.
For example FieldA is for the option group. FieldB is for the checkbox.
For my report, my textbox expression with the option group is:
=Choose([FieldA], "breast biopsy", "lumpectomy", "mastectomy", "simple
mastectomy").
my textbox expression for the field with the checkbox is:
=IIf([fieldB],"modifier 59",Null).
My question is how do I make it so that I can concatenate those 2 fields (so
that they are on the same line, with a single space). Ultimately, I may need
to connect 3 or more of these expressions.
It seems like the way to go would be to make it so that the "output/value"
of those expressions becomes a new simple field (each) and then I could use
my old ways of concatenating with the & sign or the + sign. If you can't
tell, I am a novice with structuring expressions and also working with VBA.


Seems like you only ned to do the usual thing:
=[text box A] & (" " + [text box B])

Or, if you have no other need for the other text boxes, you
can do it all in the combined text box:

=Choose([FieldA], "breast biopsy", "lumpectomy",
"mastectomy", "simple mastectomy") & (" " +
IIf([fieldB],"modifier 59",Null))
 
D

dlazenby

Marsh,
Thanks for your reply. I understand the 2nd suggestion, but I don't
understand how to implement the 1st suggestion.
Again, on the report in design view, I have one text box (named text box A)
with the control source as : =Choose([FieldA], "breast biopsy", "lumpectomy",
"mastectomy", "simple mastectomy"). The other text box (named text box B) has
the control source set as: =IIf([fieldB],"modifier 59",Null). Regarding the
first suggestion: =[text box A] & (" " + [text box B]), what would be the
fields that I would put there? text box A and text box B are names and not
fields.
dlazenby said:
I am trying to concatenate text boxes that contain different expressions and
am clueless.
My current issue is concatenating the values of 1) an option group with 2) a
field that is setup as a checkbox.
For example FieldA is for the option group. FieldB is for the checkbox.
For my report, my textbox expression with the option group is:
=Choose([FieldA], "breast biopsy", "lumpectomy", "mastectomy", "simple
mastectomy").
my textbox expression for the field with the checkbox is:
=IIf([fieldB],"modifier 59",Null).
My question is how do I make it so that I can concatenate those 2 fields (so
that they are on the same line, with a single space). Ultimately, I may need
to connect 3 or more of these expressions.
It seems like the way to go would be to make it so that the "output/value"
of those expressions becomes a new simple field (each) and then I could use
my old ways of concatenating with the & sign or the + sign. If you can't
tell, I am a novice with structuring expressions and also working with VBA.


Seems like you only ned to do the usual thing:
=[text box A] & (" " + [text box B])

Or, if you have no other need for the other text boxes, you
can do it all in the combined text box:

=Choose([FieldA], "breast biopsy", "lumpectomy",
"mastectomy", "simple mastectomy") & (" " +
IIf([fieldB],"modifier 59",Null))
 
M

Marshall Barton

You don't need to put any fields in that expression. text
box A and text box B have already calulated the two values
using fieldA and fieldB respectively. The combined
expression is just concatenating the values from the other
text boxes. Maybe it's so simple it's confusing ;-)
--
Marsh
MVP [MS Access]


dlazenby wrote:,
Thanks for your reply. I understand the 2nd suggestion, but I don't
understand how to implement the 1st suggestion.
Again, on the report in design view, I have one text box (named text box A)
with the control source as : =Choose([FieldA], "breast biopsy", "lumpectomy",
"mastectomy", "simple mastectomy"). The other text box (named text box B) has
the control source set as: =IIf([fieldB],"modifier 59",Null). Regarding the
first suggestion: =[text box A] & (" " + [text box B]), what would be the
fields that I would put there? text box A and text box B are names and not
fields.
dlazenby said:
I am trying to concatenate text boxes that contain different expressions and
am clueless.
My current issue is concatenating the values of 1) an option group with 2) a
field that is setup as a checkbox.
For example FieldA is for the option group. FieldB is for the checkbox.
For my report, my textbox expression with the option group is:
=Choose([FieldA], "breast biopsy", "lumpectomy", "mastectomy", "simple
mastectomy").
my textbox expression for the field with the checkbox is:
=IIf([fieldB],"modifier 59",Null).
My question is how do I make it so that I can concatenate those 2 fields (so
that they are on the same line, with a single space). Ultimately, I may need
to connect 3 or more of these expressions.
It seems like the way to go would be to make it so that the "output/value"
of those expressions becomes a new simple field (each) and then I could use
my old ways of concatenating with the & sign or the + sign. If you can't
tell, I am a novice with structuring expressions and also working with VBA.


Seems like you only ned to do the usual thing:
=[text box A] & (" " + [text box B])

Or, if you have no other need for the other text boxes, you
can do it all in the combined text box:

=Choose([FieldA], "breast biopsy", "lumpectomy",
"mastectomy", "simple mastectomy") & (" " +
IIf([fieldB],"modifier 59",Null))
 
D

dlazenby

Marsh,
Got it to work; as you noted-very simple. Thanks for your advice and
patience. I truly appreciate it.

Marshall Barton said:
You don't need to put any fields in that expression. text
box A and text box B have already calulated the two values
using fieldA and fieldB respectively. The combined
expression is just concatenating the values from the other
text boxes. Maybe it's so simple it's confusing ;-)
--
Marsh
MVP [MS Access]


dlazenby wrote:,
Thanks for your reply. I understand the 2nd suggestion, but I don't
understand how to implement the 1st suggestion.
Again, on the report in design view, I have one text box (named text box A)
with the control source as : =Choose([FieldA], "breast biopsy", "lumpectomy",
"mastectomy", "simple mastectomy"). The other text box (named text box B) has
the control source set as: =IIf([fieldB],"modifier 59",Null). Regarding the
first suggestion: =[text box A] & (" " + [text box B]), what would be the
fields that I would put there? text box A and text box B are names and not
fields.
dlazenby wrote:

I am trying to concatenate text boxes that contain different expressions and
am clueless.
My current issue is concatenating the values of 1) an option group with 2) a
field that is setup as a checkbox.
For example FieldA is for the option group. FieldB is for the checkbox.
For my report, my textbox expression with the option group is:
=Choose([FieldA], "breast biopsy", "lumpectomy", "mastectomy", "simple
mastectomy").
my textbox expression for the field with the checkbox is:
=IIf([fieldB],"modifier 59",Null).
My question is how do I make it so that I can concatenate those 2 fields (so
that they are on the same line, with a single space). Ultimately, I may need
to connect 3 or more of these expressions.
It seems like the way to go would be to make it so that the "output/value"
of those expressions becomes a new simple field (each) and then I could use
my old ways of concatenating with the & sign or the + sign. If you can't
tell, I am a novice with structuring expressions and also working with VBA.


Seems like you only ned to do the usual thing:
=[text box A] & (" " + [text box B])

Or, if you have no other need for the other text boxes, you
can do it all in the combined text box:

=Choose([FieldA], "breast biopsy", "lumpectomy",
"mastectomy", "simple mastectomy") & (" " +
IIf([fieldB],"modifier 59",Null))
 

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