A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Conditional format



 
 
Thread Tools Display Modes
  #1  
Old July 30th, 2007, 09:04 PM posted to microsoft.public.access.reports
seabird
external usenet poster
 
Posts: 11
Default 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  
Old July 30th, 2007, 09:18 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default 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  
Old July 30th, 2007, 09:26 PM posted to microsoft.public.access.reports
seabird
external usenet poster
 
Posts: 11
Default 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  
Old July 31st, 2007, 12:58 AM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default 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  
Old July 31st, 2007, 04:04 PM posted to microsoft.public.access.reports
seabird
external usenet poster
 
Posts: 11
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:20 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.