If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Conditional format
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?? |
#2
|
|||
|
|||
Conditional format
Seabird wrote:
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 -- Marsh MVP [MS Access] |
#3
|
|||
|
|||
Conditional format
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.... |
#4
|
|||
|
|||
Conditional format
Seabird wrote:
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. -- Marsh MVP [MS Access] |
#5
|
|||
|
|||
Conditional format
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" wrote: Seabird wrote: 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. -- Marsh MVP [MS Access] |
Thread Tools | |
Display Modes | |
|
|