By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,620 Members | 1,303 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,620 IT Pros & Developers. It's quick & easy.

reports/ can we alternate no shading and then shading for multiple records such as a phone directory to help distinguish

P: n/a
reports/ can we alternate formatting such as "no shading" and then
"shading" for multiple records such as a phone directory in Access2000
reports

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Add a text box to the Detail section of the report.
Give it these properties:
Control Source =1
Running Sum Over Group
Name txtCount
Format General Number
Visible No
You can make it as small as you like.

Add another text box to the Detail section, and make it the full size of the
Detail section. Use Send To Back on the Format menu so it lies behind the
other controls. Choose Conditional Formatting on the Format menu. Set the
first condition to:
Expression Is... [txtCount] Mod 2 = 0
and use the bucket icon to set the background color to the shade you desire.

How it works: the running-sum text box increments by 1 for each record. The
conditional formatting is applied if the value divided by 2 has a remainer
of 0, i.e. for every even number.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"buck" <ra****@kripalu.org> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
reports/ can we alternate formatting such as "no shading" and then
"shading" for multiple records such as a phone directory in Access2000
reports

Nov 13 '05 #2

P: n/a
On 16 Mar 2005 15:41:24 -0800, buck wrote:
reports/ can we alternate formatting such as "no shading" and then
"shading" for multiple records such as a phone directory in Access2000
reports


In a report? Sure.
Make sure the BackStyle of each control is Transparent.

Code the Detail Format event:

If Me.Section(0).BackColor = vbWhite Then
Me.Section(0).BackColor = 12632256 ' gray
Else
Me.Section(0).BackColor = vbWhite
End If

====
If you wish each page to start with a white row, code the Page Header
Format event:

Me.Detail.BackColor = 12632256 'Reset color to Grey so that the
first detail line will become white

Change the colors as needed.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #3

P: n/a
Public Function ShadowAlternateLines()
'Call this from the On Format event of any report Detail section
' and you'll get alternating bands of white and grey background
'This depends on the original colour being grey or white
CodeContextObject.Section(0).BackColor =
Abs(CodeContextObject.Section(0).BackColor - 31646433)
End Function
Note: you need to set the controls backstyle to transparent ...

"buck" <ra****@kripalu.org> wrote in message news:<11**********************@o13g2000cwo.googleg roups.com>...
reports/ can we alternate formatting such as "no shading" and then
"shading" for multiple records such as a phone directory in Access2000
reports

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.