473,466 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Access Conditional Formatting

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
5 8936
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be...
5
by: Richard | last post by:
Hi, I have a form that take some time to load due to many comboboxes and at least 8 subforms. When I filter or sort the main form I get an error message and then Access shuts down. They ask if...
4
by: brAccess | last post by:
I recently installed Access 2003 and immediately noticed problems with applications that work fine in 2000 and XP. I use conditional formatting on continuous forms for a number of reasons. When...
4
by: Wayne Aprato | last post by:
I have a simple database which was originally written in Access 97. When converted to Access 2000 file format it ran flawlessly in Access 2002. I've just tried to run it in Access 2003 and I am...
4
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the...
0
by: GGerard | last post by:
Hello With MSAccess 2000, I have created a program with forms and applied some Conditional Formatting on some of the text box.
8
by: Typehigh | last post by:
I have many text fields with conditional formatting applied, specifically when the condition is "Field Has Focus". Without any events associated with the fields the conditional formatting works...
1
by: dddsssdddsss | last post by:
A comment and a question To anyone who is using conditional formatting, beware that in Access 2007 the color pallette is not the same as the color pallette in Access 2003. So if you have a...
6
by: GAC | last post by:
I've used conditional formatting on ACCESS reports but have come up with a problem using it for a FIELD that has a value of either YES or blank/null. The default formatting (used when condition(s)...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.