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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strcmp Problem

Status
Not open for further replies.

Frank336

MIS
Aug 6, 2002
41
CA
Hi, (VB6, RDC(CR8.5), Access 2000)

Ive got a report with 2 columns. The columns contain numbers. When a row dont have the same number I want to set the second column to bold.

So on the field of the second column ive set the x/2 to this formula :

WhilePrintingRecords;
if strCmp ({@Before}, cstr({ado.CountofID})) = 1 then
crBold
else
crRegular


The problem is that when the second number is lower than the first one, the formula is working. But when the second number is greater than the first, its not working...

Name Before After
a 75 75 <- not bold (ok)
b 70 69 <- 69 is bold (ok)
c 70 71 <- 71 is not bold (NOT ok)


Whats wrong ?


Thanks,
Frank


 
Frank

Try changing formula to

WhilePrintingRecords;
if strCmp ({@Before}, cstr({ado.CountofID})) = 0 then
crRegular
else
crBold
This should work

However, I think you have made things difficult for yourself, you could have used the conditional formating for the font of column 2

In the conditional font formula for {ado.CountofID} use

if {@Before}<> {ado.CountofID} then crBold else crRegular

Regards

Ian Waterman
UK Crystal Programmer


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top