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

Onfirstrecord and onlastrecord issue

Status
Not open for further replies.

munchen

Technical User
Aug 24, 2004
306
GB
I am using crystal XI.

I have the details section suppressed if the following occurrs:

(
{tblA.Name}<>next({tblA.Name}) and
{tblA.Name}<>previous({tblA.Name})
)
or
(
{tblA.number}=next({tblA.number}) or
{tblA.number}=previous({tblA.number})
)

My problem is I need to also suppress the first record if the next record after the first does not have the same name as the first record.

I also need to suppress the last record if the last record's name is not the same as the name in the previous record.

In the details section suppression formula how do I suppress first and last records if they do not meet the criteria that I have explained?
 
I seem to have resolved the firstrecord issue but not the lastrecord.

Here's what I have done:

(
Onfirstrecord or
({tblA.Name}<>next({tblA.Name}) and
{tblA.Name}<>previous({tblA.Name}))
)
or
(
Onfirstrecord or
({tblA.number}=next({tblA.number}) or
{tblA.number}=previous({tblA.number}))
)

Any ideas for the onlastrecord or a better way?
 
I think that will always suppress the first record. Try:

(
Onfirstrecord and
{tblA.Name}<>next({tblA.Name})
) or
(
{tblA.Name}<>next({tblA.Name}) and
{tblA.Name}<>previous({tblA.Name})
)
or
(
onlastrecord and
{tblA.Name}<>previous({tblA.Name})
) or
(
Onfirstrecord and
{tblA.number}=next({tblA.number})
) or
(
{tblA.number}=next({tblA.number}) or
{tblA.number}=previous({tblA.number})
) or
(
onlastrecord and
{tblA.number}=previous({tblA.number})
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top