Conditional format

G

Guest

Hello everyone,

I have a report with a conditional format that works fine on the "left" page
but I created a report with the same format (the right page) and it won't
work.

It is a simple line count from a hidden field called "rulenumber"

Rulenumber =1 and not visible.

The conditional format for the whole line is: Right([rulenumber]/2,2)<>".5"

This creates alternating Background colors for the lines.

For some reason this only works on report 1 (left page) and not on report 2
(right page).

Any suggestions??
 
M

Marshall Barton

Seabird said:
I have a report with a conditional format that works fine on the "left" page
but I created a report with the same format (the right page) and it won't
work.

It is a simple line count from a hidden field called "rulenumber"

Rulenumber =1 and not visible.

The conditional format for the whole line is: Right([rulenumber]/2,2)<>".5"

This creates alternating Background colors for the lines.

For some reason this only works on report 1 (left page) and not on report 2
(right page).


Did you forget to set the text box's RunningSum property?

BTW, the standard expression to test for an even line number
is:
[rulenumber] Mod 2 = 0
 
G

Guest

BTW, the standard expression to test for an even line number
is:
[rulenumber] Mod 2 = 0

What do you mean by this? I created my own solution that has always worked
by wouldn't mind to recode to standard.

Running Sum is set to Over Group on both reports....
 
M

Marshall Barton

Seabird said:
BTW, the standard expression to test for an even line number
is:
[rulenumber] Mod 2 = 0

What do you mean by this? I created my own solution that has always worked
by wouldn't mind to recode to standard.

Running Sum is set to Over Group on both reports....

In that case I don't see why it's not working unless there's
some kind of precision issue caused by the conversion of an
integer calculation to a floating point calculation (i.e. /2
and .5). I really doubt that's an issue, but it's difficult
to be sure with all the implied type casting in your
expression. I suggest that you make the text box visible so
you can see what its value is on each line.

Check the Mod operator in VBA Help for details, but
generally it just returns the remainder of the division
[rulenumber] / 2, so even numbers have a remainder of 0 and
odd numbers have a remainder of 1. It's a simpler
expression that does not rely on any type casting.
 
G

Guest

Ok, got it solved. First I removed all the conditional formats. Saved my
file, then re-entered the exact same condition, works fine again. Don't know
where that glitch came from.

Thanks for the effort

Marshall Barton said:
Seabird said:
BTW, the standard expression to test for an even line number
is:
[rulenumber] Mod 2 = 0

What do you mean by this? I created my own solution that has always worked
by wouldn't mind to recode to standard.

Running Sum is set to Over Group on both reports....

In that case I don't see why it's not working unless there's
some kind of precision issue caused by the conversion of an
integer calculation to a floating point calculation (i.e. /2
and .5). I really doubt that's an issue, but it's difficult
to be sure with all the implied type casting in your
expression. I suggest that you make the text box visible so
you can see what its value is on each line.

Check the Mod operator in VBA Help for details, but
generally it just returns the remainder of the division
[rulenumber] / 2, so even numbers have a remainder of 0 and
odd numbers have a remainder of 1. It's a simpler
expression that does not rely on any type casting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top