Friday, February 24, 2012

Hiding Field if Data is Null

I'm simulating a mailing label-type format that contains mailing
address information:
Name
Title
Company
Address
Address2
City, State Zip
Since not all customers have an address2 line, I want to suppress the
Address2 field if it is null. This way, I don't have a blank line:
Jason Sweet
3154 Alaca Drive
Altadena, CA 91001
Possible?
Thanks in advance.
Jason SweetHi Jason,
I guess you can use the IIF function to set the height of the two text
boxes. something like =IIF(Address2 = "",0,20)
"Jaosn S" wrote:
> I'm simulating a mailing label-type format that contains mailing
> address information:
> Name
> Title
> Company
> Address
> Address2
> City, State Zip
> Since not all customers have an address2 line, I want to suppress the
> Address2 field if it is null. This way, I don't have a blank line:
> Jason Sweet
> 3154 Alaca Drive
> Altadena, CA 91001
> Possible?
> Thanks in advance.
> Jason Sweet
>|||Have each field in a different text box, then in the properties, click the
advanced button and have the visiblity set to expression and use
=iif(Fields!yourfield.Value is Nothing, true, false)
This should then hide the text box if there is no data.
Hope that helps
"Jaosn S" wrote:
> I'm simulating a mailing label-type format that contains mailing
> address information:
> Name
> Title
> Company
> Address
> Address2
> City, State Zip
> Since not all customers have an address2 line, I want to suppress the
> Address2 field if it is null. This way, I don't have a blank line:
> Jason Sweet
> 3154 Alaca Drive
> Altadena, CA 91001
> Possible?
> Thanks in advance.
> Jason Sweet
>|||Shaun,
Did you ever find out how to supress the null lines in an address?
I've tried the following IFF in the Visiblity Hidden Property:
=iif( Fields!D_ADDRESS_LINE_2.Value = "", true, false)
I've tried the following IFF in the Line Height Property:
=iif( Fields!D_ADDRESS_LINE_2.Value = "",0,2)
Neither accomplish the task. Write soon!
carla.thompson@.gwl.com
"Shaun Longhurst" wrote:
> Have each field in a different text box, then in the properties, click the
> advanced button and have the visiblity set to expression and use
> =iif(Fields!yourfield.Value is Nothing, true, false)
> This should then hide the text box if there is no data.
> Hope that helps
> "Jaosn S" wrote:
> > I'm simulating a mailing label-type format that contains mailing
> > address information:
> >
> > Name
> > Title
> > Company
> > Address
> > Address2
> > City, State Zip
> >
> > Since not all customers have an address2 line, I want to suppress the
> > Address2 field if it is null. This way, I don't have a blank line:
> >
> > Jason Sweet
> > 3154 Alaca Drive
> >
> > Altadena, CA 91001
> >
> > Possible?
> >
> > Thanks in advance.
> >
> > Jason Sweet
> >|||Jason,
Did you ever get the correct answer to this question?
Carla
"Jaosn S" wrote:
> I'm simulating a mailing label-type format that contains mailing
> address information:
> Name
> Title
> Company
> Address
> Address2
> City, State Zip
> Since not all customers have an address2 line, I want to suppress the
> Address2 field if it is null. This way, I don't have a blank line:
> Jason Sweet
> 3154 Alaca Drive
> Altadena, CA 91001
> Possible?
> Thanks in advance.
> Jason Sweet
>|||Checking for null (Nothing in VB) can be done two ways:
=(Fields!A.Value is Nothing)
=IsNothing(Fields!A.Value)
When using these expressions for the Visibility.Hidden property you should
get the desired effect.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"C. Lynn" <CLynn@.discussions.microsoft.com> wrote in message
news:787DAFAB-22B6-4BBC-9C13-EA6ADEDBB289@.microsoft.com...
> Shaun,
> Did you ever find out how to supress the null lines in an address?
> I've tried the following IFF in the Visiblity Hidden Property:
> =iif( Fields!D_ADDRESS_LINE_2.Value = "", true, false)
> I've tried the following IFF in the Line Height Property:
> =iif( Fields!D_ADDRESS_LINE_2.Value = "",0,2)
> Neither accomplish the task. Write soon!
> carla.thompson@.gwl.com
>
> "Shaun Longhurst" wrote:
>> Have each field in a different text box, then in the properties, click
>> the
>> advanced button and have the visiblity set to expression and use
>> =iif(Fields!yourfield.Value is Nothing, true, false)
>> This should then hide the text box if there is no data.
>> Hope that helps
>> "Jaosn S" wrote:
>> > I'm simulating a mailing label-type format that contains mailing
>> > address information:
>> >
>> > Name
>> > Title
>> > Company
>> > Address
>> > Address2
>> > City, State Zip
>> >
>> > Since not all customers have an address2 line, I want to suppress the
>> > Address2 field if it is null. This way, I don't have a blank line:
>> >
>> > Jason Sweet
>> > 3154 Alaca Drive
>> >
>> > Altadena, CA 91001
>> >
>> > Possible?
>> >
>> > Thanks in advance.
>> >
>> > Jason Sweet
>> >|||My solution included the following:
1. I used the IFF to set the condition of the Hidden Property of the
Visibility element.
2. If you want just the field to be "Hidden" or blanked out while
maintaining the vertical spacing by not suppressing the entire line, click
the *field*...
3. If you want the entire line to be supressed, click the line tab off to
the left of the table.
4. To set the property, go to the Visibility element and expand it to find
the Hidden Property. Click <expression> and enter the following IFF
statement:
=iif( Fields!D_ADDRESS_LINE_2.Value = "", true, false) <-- substitute your
field name. This till set the Hidden property to True if the field is Null
or False if the field contains a value.
This should work to either suppress or blank either the field or the entire
line.
~~ C. Lynn
"Jaosn S" wrote:
> I'm simulating a mailing label-type format that contains mailing
> address information:
> Name
> Title
> Company
> Address
> Address2
> City, State Zip
> Since not all customers have an address2 line, I want to suppress the
> Address2 field if it is null. This way, I don't have a blank line:
> Jason Sweet
> 3154 Alaca Drive
> Altadena, CA 91001
> Possible?
> Thanks in advance.
> Jason Sweet
>|||I use this setup for doing address labels. It works preety well.
What I do is check if address 2 exists and if it does then print it.
If not then I substitute Address 2 with the city state and zip.
Same with the CSZ line.
I hope this works for you.
=Fields!PayeeName.Value & VBCRLF &
Fields!PayeeAddressLine1.Value & VBCRLF &
IIF(IsNothing(Fields!PayeeAddressLine2.Value), Fields!PayeeCity.Value & ", "
& Fields!PayeeState.Value & " " & Fields!PayeeZipCode.Value,
Fields!PayeeAddressLine2.Value) & VBCRLF &
IIF(IsNothing(Fields!PayeeAddressLine2.Value), "",
Fields!PayeeCity.Value & ", " & Fields!PayeeState.Value & " " &
Fields!PayeeZipCode.Value)
"C. Lynn" wrote:
> My solution included the following:
> 1. I used the IFF to set the condition of the Hidden Property of the
> Visibility element.
> 2. If you want just the field to be "Hidden" or blanked out while
> maintaining the vertical spacing by not suppressing the entire line, click
> the *field*...
> 3. If you want the entire line to be supressed, click the line tab off to
> the left of the table.
> 4. To set the property, go to the Visibility element and expand it to find
> the Hidden Property. Click <expression> and enter the following IFF
> statement:
> =iif( Fields!D_ADDRESS_LINE_2.Value = "", true, false) <-- substitute your
> field name. This till set the Hidden property to True if the field is Null
> or False if the field contains a value.
> This should work to either suppress or blank either the field or the entire
> line.
> ~~ C. Lynn
>
> "Jaosn S" wrote:
> > I'm simulating a mailing label-type format that contains mailing
> > address information:
> >
> > Name
> > Title
> > Company
> > Address
> > Address2
> > City, State Zip
> >
> > Since not all customers have an address2 line, I want to suppress the
> > Address2 field if it is null. This way, I don't have a blank line:
> >
> > Jason Sweet
> > 3154 Alaca Drive
> >
> > Altadena, CA 91001
> >
> > Possible?
> >
> > Thanks in advance.
> >
> > Jason Sweet
> >|||If you use the =iff(IsNothing(field.value),true,false) in the visabillity
expression it will work.
"Fez" wrote:
> I use this setup for doing address labels. It works preety well.
> What I do is check if address 2 exists and if it does then print it.
> If not then I substitute Address 2 with the city state and zip.
> Same with the CSZ line.
> I hope this works for you.
> =Fields!PayeeName.Value & VBCRLF &
> Fields!PayeeAddressLine1.Value & VBCRLF &
> IIF(IsNothing(Fields!PayeeAddressLine2.Value), Fields!PayeeCity.Value & ", "
> & Fields!PayeeState.Value & " " & Fields!PayeeZipCode.Value,
> Fields!PayeeAddressLine2.Value) & VBCRLF &
> IIF(IsNothing(Fields!PayeeAddressLine2.Value), "",
> Fields!PayeeCity.Value & ", " & Fields!PayeeState.Value & " " &
> Fields!PayeeZipCode.Value)
> "C. Lynn" wrote:
> > My solution included the following:
> >
> > 1. I used the IFF to set the condition of the Hidden Property of the
> > Visibility element.
> > 2. If you want just the field to be "Hidden" or blanked out while
> > maintaining the vertical spacing by not suppressing the entire line, click
> > the *field*...
> > 3. If you want the entire line to be supressed, click the line tab off to
> > the left of the table.
> > 4. To set the property, go to the Visibility element and expand it to find
> > the Hidden Property. Click <expression> and enter the following IFF
> > statement:
> > =iif( Fields!D_ADDRESS_LINE_2.Value = "", true, false) <-- substitute your
> > field name. This till set the Hidden property to True if the field is Null
> > or False if the field contains a value.
> >
> > This should work to either suppress or blank either the field or the entire
> > line.
> >
> > ~~ C. Lynn
> >
> >
> > "Jaosn S" wrote:
> >
> > > I'm simulating a mailing label-type format that contains mailing
> > > address information:
> > >
> > > Name
> > > Title
> > > Company
> > > Address
> > > Address2
> > > City, State Zip
> > >
> > > Since not all customers have an address2 line, I want to suppress the
> > > Address2 field if it is null. This way, I don't have a blank line:
> > >
> > > Jason Sweet
> > > 3154 Alaca Drive
> > >
> > > Altadena, CA 91001
> > >
> > > Possible?
> > >
> > > Thanks in advance.
> > >
> > > Jason Sweet
> > >|||Good morning!
I am trying to setup mailing labels and is unable to do so.
I have no idea what I am doing wrong.
Could you please provide me with a solution that you may have.
It would be greatly appreciated.
However, I will pay for the cost of the solution provided if necessary.
Thank you very much for your assistance.
"Fez" wrote:
> I use this setup for doing address labels. It works preety well.
> What I do is check if address 2 exists and if it does then print it.
> If not then I substitute Address 2 with the city state and zip.
> Same with the CSZ line.
> I hope this works for you.
> =Fields!PayeeName.Value & VBCRLF &
> Fields!PayeeAddressLine1.Value & VBCRLF &
> IIF(IsNothing(Fields!PayeeAddressLine2.Value), Fields!PayeeCity.Value & ", "
> & Fields!PayeeState.Value & " " & Fields!PayeeZipCode.Value,
> Fields!PayeeAddressLine2.Value) & VBCRLF &
> IIF(IsNothing(Fields!PayeeAddressLine2.Value), "",
> Fields!PayeeCity.Value & ", " & Fields!PayeeState.Value & " " &
> Fields!PayeeZipCode.Value)
> "C. Lynn" wrote:
> > My solution included the following:
> >
> > 1. I used the IFF to set the condition of the Hidden Property of the
> > Visibility element.
> > 2. If you want just the field to be "Hidden" or blanked out while
> > maintaining the vertical spacing by not suppressing the entire line, click
> > the *field*...
> > 3. If you want the entire line to be supressed, click the line tab off to
> > the left of the table.
> > 4. To set the property, go to the Visibility element and expand it to find
> > the Hidden Property. Click <expression> and enter the following IFF
> > statement:
> > =iif( Fields!D_ADDRESS_LINE_2.Value = "", true, false) <-- substitute your
> > field name. This till set the Hidden property to True if the field is Null
> > or False if the field contains a value.
> >
> > This should work to either suppress or blank either the field or the entire
> > line.
> >
> > ~~ C. Lynn
> >
> >
> > "Jaosn S" wrote:
> >
> > > I'm simulating a mailing label-type format that contains mailing
> > > address information:
> > >
> > > Name
> > > Title
> > > Company
> > > Address
> > > Address2
> > > City, State Zip
> > >
> > > Since not all customers have an address2 line, I want to suppress the
> > > Address2 field if it is null. This way, I don't have a blank line:
> > >
> > > Jason Sweet
> > > 3154 Alaca Drive
> > >
> > > Altadena, CA 91001
> > >
> > > Possible?
> > >
> > > Thanks in advance.
> > >
> > > Jason Sweet
> > >|||Good morning!
I am trying to setup mailing labels and is unable to do so.
I have no idea what I am doing wrong.
Could you please provide me with a solution that you may have.
It would be greatly appreciated.
However, I will pay for the cost of the solution provided if necessary.
Thank you very much for your assistance.
"Shaun Longhurst" wrote:
> Have each field in a different text box, then in the properties, click the
> advanced button and have the visiblity set to expression and use
> =iif(Fields!yourfield.Value is Nothing, true, false)
> This should then hide the text box if there is no data.
> Hope that helps
> "Jaosn S" wrote:
> > I'm simulating a mailing label-type format that contains mailing
> > address information:
> >
> > Name
> > Title
> > Company
> > Address
> > Address2
> > City, State Zip
> >
> > Since not all customers have an address2 line, I want to suppress the
> > Address2 field if it is null. This way, I don't have a blank line:
> >
> > Jason Sweet
> > 3154 Alaca Drive
> >
> > Altadena, CA 91001
> >
> > Possible?
> >
> > Thanks in advance.
> >
> > Jason Sweet
> >|||Good morning!
I am trying to setup mailing labels and is unable to do so.
I have no idea what I am doing wrong.
Could you please provide me with a solution that you may have.
It would be greatly appreciated.
However, I will pay for the cost of the solution provided if necessary.
Thank you very much for your assistance.
"C. Lynn" wrote:
> Jason,
> Did you ever get the correct answer to this question?
> Carla
> "Jaosn S" wrote:
> > I'm simulating a mailing label-type format that contains mailing
> > address information:
> >
> > Name
> > Title
> > Company
> > Address
> > Address2
> > City, State Zip
> >
> > Since not all customers have an address2 line, I want to suppress the
> > Address2 field if it is null. This way, I don't have a blank line:
> >
> > Jason Sweet
> > 3154 Alaca Drive
> >
> > Altadena, CA 91001
> >
> > Possible?
> >
> > Thanks in advance.
> >
> > Jason Sweet
> >|||Good morning!
I am trying to setup mailing labels and is unable to do so.
I have no idea what I am doing wrong.
Could you please provide me with a solution that you may have.
It would be greatly appreciated.
However, I will pay for the cost of the solution provided if necessary.
Thank you very much for your assistance.
"Jaosn S" wrote:
> I'm simulating a mailing label-type format that contains mailing
> address information:
> Name
> Title
> Company
> Address
> Address2
> City, State Zip
> Since not all customers have an address2 line, I want to suppress the
> Address2 field if it is null. This way, I don't have a blank line:
> Jason Sweet
> 3154 Alaca Drive
> Altadena, CA 91001
> Possible?
> Thanks in advance.
> Jason Sweet
>|||I type your suggestion (below) into the visible property of one of my label
lines and it still is not hiding the line. Do you have any other
suggestions? Thanks for your help.
"Linda Anton" wrote:
> If you use the =iff(IsNothing(field.value),true,false) in the visabillity
> expression it will work.
> "Fez" wrote:
> > I use this setup for doing address labels. It works preety well.
> > What I do is check if address 2 exists and if it does then print it.
> > If not then I substitute Address 2 with the city state and zip.
> > Same with the CSZ line.
> > I hope this works for you.
> >
> > =Fields!PayeeName.Value & VBCRLF &
> > Fields!PayeeAddressLine1.Value & VBCRLF &
> > IIF(IsNothing(Fields!PayeeAddressLine2.Value), Fields!PayeeCity.Value & ", "
> > & Fields!PayeeState.Value & " " & Fields!PayeeZipCode.Value,
> > Fields!PayeeAddressLine2.Value) & VBCRLF &
> > IIF(IsNothing(Fields!PayeeAddressLine2.Value), "",
> > Fields!PayeeCity.Value & ", " & Fields!PayeeState.Value & " " &
> > Fields!PayeeZipCode.Value)
> >
> > "C. Lynn" wrote:
> >
> > > My solution included the following:
> > >
> > > 1. I used the IFF to set the condition of the Hidden Property of the
> > > Visibility element.
> > > 2. If you want just the field to be "Hidden" or blanked out while
> > > maintaining the vertical spacing by not suppressing the entire line, click
> > > the *field*...
> > > 3. If you want the entire line to be supressed, click the line tab off to
> > > the left of the table.
> > > 4. To set the property, go to the Visibility element and expand it to find
> > > the Hidden Property. Click <expression> and enter the following IFF
> > > statement:
> > > =iif( Fields!D_ADDRESS_LINE_2.Value = "", true, false) <-- substitute your
> > > field name. This till set the Hidden property to True if the field is Null
> > > or False if the field contains a value.
> > >
> > > This should work to either suppress or blank either the field or the entire
> > > line.
> > >
> > > ~~ C. Lynn
> > >
> > >
> > > "Jaosn S" wrote:
> > >
> > > > I'm simulating a mailing label-type format that contains mailing
> > > > address information:
> > > >
> > > > Name
> > > > Title
> > > > Company
> > > > Address
> > > > Address2
> > > > City, State Zip
> > > >
> > > > Since not all customers have an address2 line, I want to suppress the
> > > > Address2 field if it is null. This way, I don't have a blank line:
> > > >
> > > > Jason Sweet
> > > > 3154 Alaca Drive
> > > >
> > > > Altadena, CA 91001
> > > >
> > > > Possible?
> > > >
> > > > Thanks in advance.
> > > >
> > > > Jason Sweet
> > > >

No comments:

Post a Comment