Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format Text Suppression formula not working correctly

Status
Not open for further replies.

markajem

Programmer
Dec 20, 2001
564
US
I am attempting to suppress a text field if other values are not meet.

In the format section I have a check box and then in the formula box I have:

(InStr({SOP10100.CSTPONBR}, "S") = 0)
and
({SOP10100.CUSTNMBR} <> &quot;525900&quot;)

This means if the {SOP10100.CUSTNMBR} does not equal 525900 AND within string {SOP10100.CSTPONBR} there is not the letter &quot;S&quot; then suppress the field.

otherwise if {SOP10100.CUSTNMBR} = &quot;525900&quot; AND string {SOP10100.CSTPONBR} contains an &quot;S&quot; show the text.

If I use only one or the other I get results but if i used the two together I get the text to appear.

What the heck am I missing here.

Thanks


Mark
Email: markanas333@hotmail.com
 
It looks like whatever the customer number is, you want those fields without an &quot;S&quot; to be suppressed, so you really only need:

InStr({SOP10100.CSTPONBR}, &quot;S&quot;) = 0

With your formula, no records with customer number = &quot;525900&quot; can meet both conditions, and therefore no records are suppressed for this number.

-LB
 
Okay maybe I should reword what I need.

If {SOP10100.CUSTNMBR} = &quot;525900&quot;

and

There is a letter &quot;S&quot; in {SOP10100.CSTPONBR}

then I want the text to appear.

I don't want the text to appear if only one of the conditions are met because there are some records for 525900 that I don't want this to show for and I don't want all PO's ({SOP10100.CSTPONBR}) that have a letter &quot;S&quot; in them for all customers.

Thanks


Mark
Email: markanas333@hotmail.com
 
In theory, the clause as you have it should work. Try restating the criteria in an alternative way:

If InStr({SOP10100.CSTPONBR}, &quot;S&quot;) > 0
Then False
Else
If {SOP10100.CUSTNMBR} <> &quot;525900&quot; -- [This is a char field storing numbers, right?]
Then True
Else False

Naith
 
If you ONLY want records to appear where {SOP10100.CUSTNMBR} = &quot;525900&quot; and there is a letter &quot;S&quot; in {SOP10100.CSTPONBR}, then your suppression formula should be:

{SOP10100.CUSTNMBR} <> &quot;525900&quot; or
InStr({SOP10100.CSTPONBR}, &quot;S&quot;) = 0

-LB

 
logic is fun...isn't it!

let me tak a stab at this

***********

This means if the {SOP10100.CUSTNMBR} does not equal 525900 AND within string {SOP10100.CSTPONBR} there is not the letter &quot;S&quot; then suppress the field.

otherwise if {SOP10100.CUSTNMBR} = &quot;525900&quot; AND string {SOP10100.CSTPONBR} contains an &quot;S&quot; show the text.

*****************

So you really want {SOP10100.CSTPONBR} to have &quot;S&quot; in the value...why don't you eliminate ALL bad values at the record selection stage by adding the following to the record selection

&quot;S&quot; in {SOP10100.CSTPONBR} and
...


otherwise if you need those other non-S {SOP10100.CSTPONBR} values for other reasons in your report then this is all that is required in the conditional suppress for the text field

WhilePrintingRecords;
not(&quot;S&quot; in {SOP10100.CSTPONBR});


Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
I do not want to use the record selector because I need the records to show. I am just trying to &quot;flag&quot; certain ones according to the criteria so that it prints a phrase on the report for those particular records so the report user knows they need to take further action somewhere else in thier job. but it is important she sees all the records. These records are all sales orders that came in via EDI that day so all records must be on the report. This criteria will just tell her as I said further action with those particular orders is needed elsewhere in her job.

Mark
Email: markanas333@hotmail.com
 
Just for fun uncheck the checkbox and just use your original suppression formula.

Mike S
 
I will repeat myself here

*******************************
otherwise if you need those other non-S {SOP10100.CSTPONBR} values for other reasons in your report then this is all that is required in the conditional suppress for the text field

WhilePrintingRecords;
not(&quot;S&quot; in {SOP10100.CSTPONBR});
*************************************


Your suppression formula boils down to the fact that no matter what the customer number is....you DON'T want displays if there is an &quot;S&quot; in the corresponding {SOP10100.CSTPONBR} that formula should work

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
sorry...if there is is an &quot;S&quot; you want to show the field otherwise suppress it....my formula is correct....my stating how it worked was wrong...

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Jim, the formula

WhilePrintingRecords;
not(&quot;S&quot; in {SOP10100.CSTPONBR});


works but suppresses the text for all {SOP10100.CSTPONBR} that contain an S in them. I don't want the text field to show unless the

{SOP10100.CUSTNMBR} = &quot;525900&quot;
and
(&quot;S&quot; in {SOP10100.CSTPONBR})


Naith
{SOP10100.CUSTNMBR} <> &quot;525900&quot; -- [This is a char field storing numbers, right?] <-- Yes, this is a string field not a number.

Here is a sample of what I need.
Note: POAlert is where my text field shows up under the condition.
[tt]

SOP # PO# Cust# Qty POAlert
------- ------- -------- ------ ----------
200392 E83722 525900 233
201028 987293 882739 122
201130 S83928 525900 154 &quot;Special&quot;
202003 837223 525900 190
203847 S88472 557449 110
204555 S09994 525900 150 &quot;Special&quot;
205599 827777 888000 110
[/tt]
Now in the example above you will see there are several PO#'s that start with &quot;S&quot; but the phrase &quot;Special&quot; should only appear if there is an &quot;S&quot; in the PO# and then customer # is 525900. Also notice that there are more than one PO#'s that have an &quot;S&quot; in them but are not from customer 525900. I don't want the phrase to show for those.

I hope I have made it clearer now and sorry if I confused you.


Mark
Email: markanas333@hotmail.com
 
ok a final formula

WhilePrintingRecords;

not ({SOP10100.CUSTNMBR} = &quot;525900&quot; and
(&quot;S&quot; in {SOP10100.CSTPONBR}));

so to write out this we well

not suppress this formula if cust num is &quot;525900&quot; and there is an &quot;S&quot; in the number

this should work....logic is often so hard to describe in words...the example data made it crystal clear as to what you wanted...take that as a lesson


Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
As I said earlier, your suppression formula should be:

{SOP10100.CUSTNMBR} <> &quot;525900&quot; or
InStr({SOP10100.CSTPONBR}, &quot;S&quot;) = 0

Did you try this? With &quot;or&quot; statements, if a record meets the first criterion, it will be suppressed--so the first clause will eliminate all records except those = &quot;525900.&quot; For a record that doesn't meet that first criterion, and that would be those = &quot;525900&quot;, the formula then sees if it meets the second criterion--so the second clause will suppress any record = &quot;525900&quot; that doesn't have an &quot;S&quot; in it.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top