compare to record above in detail section?

bionicman

Registered User.
Local time
Today, 14:04
Joined
Jul 22, 2003
Messages
145
Is it possible to compare the current value to that of the one above in the detail section of a report then change the color to red or something? Unless conditional formatting can do more than I know of, i don't think i can use that because the values in the fields could be different each time.

For my example i will use Yes and No, but this is not how it is in my report.

Code:
ID    Answer To Compare
1     YES
7     YES
10    [COLOR="Red"]NO[/COLOR]
14    NO
16    [COLOR="red"]YES[/COLOR]
17    [COLOR="red"]NO[/COLOR]

I want the field to be a different color if it is different than the record above it. I have gotten this to work by referencing the ID from the previous record, but i don't know how to just look at the record above it because it could have a different ID number. So as you can see in my example, the ID numbers are non-sequintial.

Thanks in advance!
 
Use the tag property to lever out the previous value
 
Peter:
Yes, it will be sorted by ID, i will actually be grouping by ID, so i don't want one group to read from the previous group either. I should have made my example be like this:

Code:
ID  Answer1  Answer2
1   Yes         No
1   Yes         [COLOR="Red"]Yes[/COLOR]
1   [COLOR="red"]No[/COLOR]          Yes

2   Yes         No
2   [COLOR="red"]No[/COLOR]          [COLOR="red"]Yes[/COLOR]


Rich:
Can you give me some more information? I'm not familiar with this. I looked in help, all i could find was something about smart tags, is that the same thing?
 
Thanks Rich, I think that is going to work perfectly for me.

I have a couple questions though... can i use this method with more than one column? for example if i want to compare two things to the two records above them? I tried using a different section number, but anything other than section(0) told me it was invalid... i guess i don't understand this part.

I tried replacing the section tag with a global variable, but it only showed the very first record, instead of looping through each one. Any ideas here?

Thanks in advance!
 
nevermind, it was user error that was preventing the global variables from working :)

Thanks again!!
 

Users who are viewing this thread

Back
Top Bottom