Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remainder Function?

Status
Not open for further replies.

straybullet

IS-IT--Management
Jun 5, 2003
593
US
In Crystal Reports, I am able to shade the background of every other row in the detail section based on the following which will make the detail background Silver if the number in {RCount} is odd. The {RCount} field is a running count, resetting at the start of each group. Even rows remain White:

If Remainder({RCount},2)<>0 Then
crSilver
Else
crWhite

I can set up the running count, but what would the Access equivilant to the Remainder function be?

Let them hate - so long as they fear... Lucius Accius
 
Thank you!

Let them hate - so long as they fear... Lucius Accius
 
on the other hand, the Iffy thing (and the counting are not at all necessary ...

a simple xor of appropiate color selection works with out them




MichaelRed


 
Where do u put the Mod? In the formatting section? Is this a function that u created? I want to do the same thing to my report.
 
hmmmmmmmmmmmmmmmmmmmmmmmm ... mmmmmmmmmmmmmmmmmmmmm

somewhat contrived ...

at the risk of offending

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.Section("Detail").BackColor = Me.Section("Detail").BackColor Xor RGB(32, 32, 32)
End Sub
[code]

Changing the arguments to the (intrinsic) function RGB will change the 'color' of the background.  Keeping them equal will always return a shard of grey (until it turns BLACK of course).  The three args are ... simplistically the 'saturation' of the three color constituents of the final color.

In the form shown, the process is useful in generating various 'colors' to see how they work.  In (most) production environments, the actual color would be substuited as in:

[code]
? vbWhite xor rgb(32, 32, 32)
 14671839

and the actual (production) code:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.Section("Detail").BackColor = Me.Section("Detail").BackColor Xor 14671839
End Sub

with, perhaps, some embilishment by staunch supporters of programming with style and embedded documentation declaring the constant and providing commentary re the value and its determination / selection.



MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top