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

Access Conditional Formatting

P: n/a
Does anyone know a way you can use conditional formatting to create a banded
style view as is commonly seen on the internet. (In othe words the first
record appears on a gray background, the 2nd on white, the third on gray etc
etc.) I could write an expression based on the odd/even status of the
primary key but this wont work when sorting and filtering is applied.

Any suggestions gratefully received.
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
1. Add a text box to the report with these properties:
Control Source =1
Running Sum Over Group
Format General Number
Visible No
Name txtCount

2. Add another text box, the full size of the detail section. Place it
behind all the others (Send To Back on the Format menu).

3. Set conditional formatting on this 2nd box:
Expression Is ([txtCount] Mod 2 = 0)

--
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.

"Andrew Chanter" <he****@radsolutions.com.au> wrote in message
news:HQ******************@news-server.bigpond.net.au...
Does anyone know a way you can use conditional formatting to create a
banded
style view as is commonly seen on the internet. (In othe words the first
record appears on a gray background, the 2nd on white, the third on gray
etc
etc.) I could write an expression based on the odd/even status of the
primary key but this wont work when sorting and filtering is applied.

Any suggestions gratefully received.

Nov 13 '05 #2

P: n/a
Thanx Allen

AJC
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
1. Add a text box to the report with these properties:
Control Source =1
Running Sum Over Group
Format General Number
Visible No
Name txtCount

2. Add another text box, the full size of the detail section. Place it
behind all the others (Send To Back on the Format menu).

3. Set conditional formatting on this 2nd box:
Expression Is ([txtCount] Mod 2 = 0)

--
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.

"Andrew Chanter" <he****@radsolutions.com.au> wrote in message
news:HQ******************@news-server.bigpond.net.au...
Does anyone know a way you can use conditional formatting to create a
banded
style view as is commonly seen on the internet. (In othe words the first record appears on a gray background, the 2nd on white, the third on gray
etc
etc.) I could write an expression based on the odd/even status of the
primary key but this wont work when sorting and filtering is applied.

Any suggestions gratefully received.


Nov 13 '05 #3

P: n/a
Hang on a second, you cant get a running sum on a text box in a form. Does
this mean this solution will only apply to a report? (I wanted a screen
presentation).
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
1. Add a text box to the report with these properties:
Control Source =1
Running Sum Over Group
Format General Number
Visible No
Name txtCount

2. Add another text box, the full size of the detail section. Place it
behind all the others (Send To Back on the Format menu).

3. Set conditional formatting on this 2nd box:
Expression Is ([txtCount] Mod 2 = 0)

--
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.

"Andrew Chanter" <he****@radsolutions.com.au> wrote in message
news:HQ******************@news-server.bigpond.net.au...
Does anyone know a way you can use conditional formatting to create a
banded
style view as is commonly seen on the internet. (In othe words the first record appears on a gray background, the 2nd on white, the third on gray
etc
etc.) I could write an expression based on the odd/even status of the
primary key but this wont work when sorting and filtering is applied.

Any suggestions gratefully received.


Nov 13 '05 #4

P: n/a
Yes, that suggestion works only for reports.

If you are trying to do this in a form, Stephen Lebans has something at:
http://www.lebans.com/alternatecolordetailsection.htm

--
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.

"Andrew Chanter" <he****@radsolutions.com.au> wrote in message
news:IZ******************@news-server.bigpond.net.au...
Hang on a second, you cant get a running sum on a text box in a form.
Does
this mean this solution will only apply to a report? (I wanted a screen
presentation).
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
1. Add a text box to the report with these properties:
Control Source =1
Running Sum Over Group
Format General Number
Visible No
Name txtCount

2. Add another text box, the full size of the detail section. Place it
behind all the others (Send To Back on the Format menu).

3. Set conditional formatting on this 2nd box:
Expression Is ([txtCount] Mod 2 = 0)
"Andrew Chanter" <he****@radsolutions.com.au> wrote in message
news:HQ******************@news-server.bigpond.net.au...
> Does anyone know a way you can use conditional formatting to create a
> banded
> style view as is commonly seen on the internet. (In othe words the first > record appears on a gray background, the 2nd on white, the third on
> gray
> etc
> etc.) I could write an expression based on the odd/even status of the
> primary key but this wont work when sorting and filtering is applied.
>
> Any suggestions gratefully received.

Nov 13 '05 #5

P: n/a
There is also another solution to this issue, usingConditional
Formatting, in the CF sample MDB here:
http://www.lebans.com/conditionalformatting.htm
New Feb 08,2002. Added support for Datasheet view and SubForms.

A2KConditionalFormatting.zip is a sample MDB demonstrating how to
programmatically setup Conditional Formatting to simulate:

1) Highlighting of the Current Row for a Form in Continuous or Datasheet
View

2) Highlighting of Alternate Rows for a Form in Continuous or Datasheet
View

Version 2.7

Added sample demonstrating how to achieve a background
Hover/Highlighting of rows for a form in Continuous view.

Version 2.3

Added sample demonstrating how to achieve pseudo enable/disable of an
unbound control on a form in Continuous View.

Version 1.9

Added sample form to show how to apply conditional formatting to based
on a Boolean(Yes/No) field.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
Yes, that suggestion works only for reports.

If you are trying to do this in a form, Stephen Lebans has something at: http://www.lebans.com/alternatecolordetailsection.htm

--
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.

"Andrew Chanter" <he****@radsolutions.com.au> wrote in message
news:IZ******************@news-server.bigpond.net.au...
Hang on a second, you cant get a running sum on a text box in a form. Does
this mean this solution will only apply to a report? (I wanted a screen presentation).
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
1. Add a text box to the report with these properties:
Control Source =1
Running Sum Over Group
Format General Number
Visible No
Name txtCount

2. Add another text box, the full size of the detail section. Place it behind all the others (Send To Back on the Format menu).

3. Set conditional formatting on this 2nd box:
Expression Is ([txtCount] Mod 2 = 0)
"Andrew Chanter" <he****@radsolutions.com.au> wrote in message
news:HQ******************@news-server.bigpond.net.au...
> Does anyone know a way you can use conditional formatting to create a > banded
> style view as is commonly seen on the internet. (In othe words the
first
> record appears on a gray background, the 2nd on white, the third

on > gray
> etc
> etc.) I could write an expression based on the odd/even status of the > primary key but this wont work when sorting and filtering is applied. >
> Any suggestions gratefully received.



Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.