Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / July 2007

Tip: Looking for answers? Try searching our database.

Conditional format

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Seabird - 30 Jul 2007 21:04 GMT
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??
Marshall Barton - 30 Jul 2007 21:18 GMT
>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
[quoted text clipped - 10 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

Signature

Marsh
MVP [MS Access]

Seabird - 30 Jul 2007 21:26 GMT
> 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....
Marshall Barton - 31 Jul 2007 00:57 GMT
>> BTW, the standard expression to test for an even line number
>> is:
[quoted text clipped - 4 lines]
>
>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.

Signature

Marsh
MVP [MS Access]

Seabird - 31 Jul 2007 16:04 GMT
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

> >> BTW, the standard expression to test for an even line number
> >> is:
[quoted text clipped - 18 lines]
> odd numbers have a remainder of 1.  It's a simpler
> expression that does not rely on any type casting.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.