Wednesday, March 7, 2012

How can I hide a textbox using iif field condition...help?

Ok,
I have a set of textboxs on the left (in header) and on the right.
If the data comes accross as this, its ok to show it (notice that
addresses are different):
SOLD TO: SHIPPED TO:
John Doe John Doe
123 This Place 321 That Place
Anywhere, TN 37777 Anywhere, TN 37777
But, if the data comes across as this, its NOT ok to show the SHIPPED
TO (notice that addresses are Same):
SOLD TO: SHIPPED TO:
John Doe John Doe
123 This Place 123 This Place
Anywhere, TN 37777 Anywhere, TN 37777
It is supposed to look like this:
SOLD TO: SHIPPED TO:
John Doe SAME
123 This Place
Anywhere, TN 37777
How can I write an expression to display this way on the visibility
condition?
Is it something like this?:
In the SHIPPED TO name textbox (let's say TextBox1) and SHIPPED TO
address TextBox9 is what constitutes the condition, under visibility
tab:
=IIF(Fields!TextBox2.Value.ToString() = TextBox9.Value,False, True)
////TextBox2 is where the Sold To Address is.
Any help is apprectiated.
Thanks,
Trintthat's the basic idea but what you really are comparing are the
fields!SOLD_TO_ADDRESS.Value = fields!SHIP_TO_ADDRESS.Value not the text box
values themselves, you have to compare the values of the fields in your
dataset. so keep your same construct, just make sure of what you're
comparing.
"trint" wrote:
> Ok,
> I have a set of textboxs on the left (in header) and on the right.
> If the data comes accross as this, its ok to show it (notice that
> addresses are different):
> SOLD TO: SHIPPED TO:
> John Doe John Doe
> 123 This Place 321 That Place
> Anywhere, TN 37777 Anywhere, TN 37777
> But, if the data comes across as this, its NOT ok to show the SHIPPED
> TO (notice that addresses are Same):
> SOLD TO: SHIPPED TO:
> John Doe John Doe
> 123 This Place 123 This Place
> Anywhere, TN 37777 Anywhere, TN 37777
> It is supposed to look like this:
> SOLD TO: SHIPPED TO:
> John Doe SAME
> 123 This Place
> Anywhere, TN 37777
> How can I write an expression to display this way on the visibility
> condition?
> Is it something like this?:
> In the SHIPPED TO name textbox (let's say TextBox1) and SHIPPED TO
> address TextBox9 is what constitutes the condition, under visibility
> tab:
> =IIF(Fields!TextBox2.Value.ToString() = TextBox9.Value,False, True)
> ////TextBox2 is where the Sold To Address is.
> Any help is apprectiated.
> Thanks,
> Trint
>|||Yeah! Now, how do I use this in an iif expression.
Thanks,
Trint|||you'll need to have coditional visibility AND conditional value for your
ship_to text box. I'm assuming you have separate text boxes for each line (
ship_to_name, ship_to_address, ship_to_city_state_zip , same for sold_to text
boxes)
*** VISIBILITY SHIP TO TEXT BOX**
=IIF(Fields!SOLD_TO_ADDRESS.Value = Fields!SHIP_TO_ADDRESS.Value,False, True)
do the same for each text box that may need to be hidden.
you need to conditional format for the ship_to_name to display "SAME" and
not the actual person's name. Use the same type logic.
*** SHIPPED_TO_NAME text box value property
=IIF(Fields!SOLD_TO_ADDRESS.Value = Fields!SHIP_TO_ADDRESS.Value,"SAME",
Fields!SHIPPED_TO_NAME.Value)
"trint" wrote:
> Yeah! Now, how do I use this in an iif expression.
> Thanks,
> Trint
>|||Thank you Mike, I am testing my app...
Trint|||That was it Mike!
Thanks,
Trint

No comments:

Post a Comment