Expression in Label Report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a label table where there is a column for building #'s. Only about
half of these fields have a text in them. I'd like to write an expression in
the label report that says if there is an item in the field put the word
Buidling in front on it, if not skip the line. I've tried some things but I
keep getting the word building on lines where these is no text for that
field.
 
Regi said:
I have a label table where there is a column for building #'s. Only about
half of these fields have a text in them. I'd like to write an expression
in
the label report that says if there is an item in the field put the word
Buidling in front on it, if not skip the line. I've tried some things but
I
keep getting the word building on lines where these is no text for that
field.


=IIf(Len([TestText] & "")=0,"","Building " & [TestText])

Replace "TestText" in this example with the name of your building number
field. Also make sure that the name of the text box on the report is not the
same as the name of the field, or you will get an error message that the
control has a reference to itself.
 
I am having a circular reference problem. The name in the table and Query is
BLDG in the report I changed the Text box name to BLDG#. What am I missing?
Thanks Regi

Brendan Reynolds said:
Regi said:
I have a label table where there is a column for building #'s. Only about
half of these fields have a text in them. I'd like to write an expression
in
the label report that says if there is an item in the field put the word
Buidling in front on it, if not skip the line. I've tried some things but
I
keep getting the word building on lines where these is no text for that
field.


=IIf(Len([TestText] & "")=0,"","Building " & [TestText])

Replace "TestText" in this example with the name of your building number
field. Also make sure that the name of the text box on the report is not the
same as the name of the field, or you will get an error message that the
control has a reference to itself.
 
Regi said:
I am having a circular reference problem. The name in the table and Query
is
BLDG in the report I changed the Text box name to BLDG#. What am I
missing?
Thanks Regi


If you could copy and post the expression from the Control Source property
of the text box, it might be possible to see what the problem is.
 
=IIf(Len([BLDG#] & "")=0,"","Building" & [BLDG#])
Thanks

Regi said:
I am having a circular reference problem. The name in the table and Query is
BLDG in the report I changed the Text box name to BLDG#. What am I missing?
Thanks Regi

Brendan Reynolds said:
Regi said:
I have a label table where there is a column for building #'s. Only about
half of these fields have a text in them. I'd like to write an expression
in
the label report that says if there is an item in the field put the word
Buidling in front on it, if not skip the line. I've tried some things but
I
keep getting the word building on lines where these is no text for that
field.


=IIf(Len([TestText] & "")=0,"","Building " & [TestText])

Replace "TestText" in this example with the name of your building number
field. Also make sure that the name of the text box on the report is not the
same as the name of the field, or you will get an error message that the
control has a reference to itself.
 
Well there you go then ... you've got the name of the text box instead of
the name of the field in the expression. You need to change both references
to "BLDG#" in the expression to "BLDG".

You may have fallen prey to the "Name AutoCorrect" feature, which may have
"helpfully" rewritten the expression for you when you changed the name of
the text box.
=IIf(Len([BLDG#] & "")=0,"","Building" & [BLDG#])
Thanks

Regi said:
I am having a circular reference problem. The name in the table and Query
is
BLDG in the report I changed the Text box name to BLDG#. What am I
missing?

<snip>
 
Thanks Brenda! I think you're right about the Name auto correct. I appreciate
your help! Regi

Brendan Reynolds said:
Well there you go then ... you've got the name of the text box instead of
the name of the field in the expression. You need to change both references
to "BLDG#" in the expression to "BLDG".

You may have fallen prey to the "Name AutoCorrect" feature, which may have
"helpfully" rewritten the expression for you when you changed the name of
the text box.
=IIf(Len([BLDG#] & "")=0,"","Building" & [BLDG#])
Thanks

Regi said:
I am having a circular reference problem. The name in the table and Query
is
BLDG in the report I changed the Text box name to BLDG#. What am I
missing?

<snip>
 
Back
Top