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!

try, try again: Previous(fld) function affecting 1st line

Status
Not open for further replies.

CarolineS

Programmer
Aug 31, 2001
33
CA
I got no response to this prob. my first time out, so am trying again ...

I'm creating a report in which several item lines may appear for any given invoice payment. Each line must show, but the first item line is the most important.

So if three lines have the same payment number, I'm conditionally formatting the fields' font by saying:
If {pymnt#} = Previous({pymnt#}) then crGray else crBlack.

This is working fine, except for the fact that the first line of the report is also responding to this criteria, and the fields are appearing as gray. Anyone know how to avoid this?

Thanks
 
I think your problem is that on the first line the previous field is Null so the formula fails

so try this

if not PreviousIsNull ({pymnt#}) then
(If {pymnt#} = Previous({pymnt#}) then
crGray
else
crBlack;)
else
crBlack;

the brackets are not really necessary but I find it easier to read .

Jim


 
You can also use the functions OnFirstRecord or OnLastRecord. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Hi,

I got pulled away to another report for several days ...
I used ngolem's "if not PreviousIsNull(pymnt#) then ..." and it worked like a charm.

thank you both for your help!


Caro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top