473,739 Members | 9,879 Online
Bytes | Software Development & Data Engineering Community
+ 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 8967
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****@radsolu tions.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*********@Se eSig.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****@radsolu tions.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*********@Se eSig.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****@radsolu tions.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****@radsolu tions.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*********@Se eSig.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****@radsolu tions.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, usingConditiona l
Formatting, in the CF sample MDB here:
http://www.lebans.com/conditionalformatting.htm
New Feb 08,2002. Added support for Datasheet view and SubForms.

A2KConditionalF ormatting.zip is a sample MDB demonstrating how to
programmaticall y 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*********@Se eSig.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****@radsolu tions.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*********@Se eSig.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****@radsolu tions.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
5932
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 terminated by pressing ++ and then terminate the process. I searched the entire internet and found out that there could be two things wrong (both of them are mentioned in the bug list on the access
5
3087
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 I want to send the error report to Microsoft. Has anybody seen this type of error message and what can I do to prevent it from happening. Am I doing something illegal in my code? It used to work but I have added conditional formatting to a subform...
4
6881
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 these forms are opened in 2003, Access seems to go into a continuous loop. Has anyone else experienced this problem? Does anyone know of a solution short of not using conditional formatting in continuous forms? Here is an example:
4
2137
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 seeing the following behaviour: Some of the fields on the continuous main form which is a list of jobs with their related details "flicker". While this is going on the form seems to function as it should and isn't locked up. If I click and hold...
4
3138
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 background colour. In A2000 it works great, but in A2003 the background doesn't always change and when it does it only changes when the record looses the focus. Any way around this? Is it a bug? Or have they "improved" it?
0
657
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
8506
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 perfectly. However, I have code that runs under the ON CLICK event. The code changes the focus to other controls, which means the conditional formatting is no longer displayed. This part makes sense to me. Here's what doesn't make sense. The last...
1
4231
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 particular color you were using as a standard throughout your application, the only way to continue using that color is to code the color. Anyone else notice how forms in Access 2007 display the conditional formatting much slower than in Access...
6
3651
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) are not met) is always used EVEN WHEN I specify Condition 1 to change the formatting when the field is YES. What am I missing....doesn't conditional formatting work on fields defined as TEXT with values of YES or Blank(Null)?
0
8792
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9337
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9266
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9209
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8215
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4570
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3280
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 we have to send another system
2
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.