473,395 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Alternate Line Shading

Using a bit of code to produce alternate line shading in a report.
Seems it should work for a form as well but no luck. Does anyone have
any ideas what I need to change or if it is even possible to alternate
shade a form???

Private Sub Alternate_Detail_Format(Cancel As Integer, FormatCount As
Integer)

Const vbLightGrey = 12632256

If Me.CurrentRecord Mod 2 = 0 Then
Me.Section(acDetail).BackColor = vbLightGrey
Else
Me.Section(acDetail).BackColor = vbWhite
End If

End Sub
Nov 12 '05 #1
1 7327
Here are a couple of solutions.
For A97 or higher:
http://www.lebans.com/alternatecolordetailsection.htm
AlternateColorDetailSection.zip is a class to allow for alternate bands
of color for Forms in Continuous View.

For A2K or higher using Conditional Formatting for forms in Continuous
or Datasheet view see:
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.
"jeffgeorge" <ki*******@aol.com> wrote in message
news:4f**************************@posting.google.c om...
Using a bit of code to produce alternate line shading in a report.
Seems it should work for a form as well but no luck. Does anyone have
any ideas what I need to change or if it is even possible to alternate
shade a form???

Private Sub Alternate_Detail_Format(Cancel As Integer, FormatCount As
Integer)

Const vbLightGrey = 12632256

If Me.CurrentRecord Mod 2 = 0 Then
Me.Section(acDetail).BackColor = vbLightGrey
Else
Me.Section(acDetail).BackColor = vbWhite
End If

End Sub


Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: i6033162556-signup1 | last post by:
How do I remove the new line after </form> It looks very bad in my HTML, as each <form></form> will create a new line after the block of </form> Is there a way for me to remove it?
1
by: news | last post by:
Hi all, How do you implement alternate line colors in ms access datasheet view Regards Joe --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system...
3
by: buck | last post by:
reports/ can we alternate formatting such as "no shading" and then "shading" for multiple records such as a phone directory in Access2000 reports
3
by: Gary O | last post by:
I would like to compile a class I have built to a library. I use the following command line: vbc /reference:Microsoft.VisualBasic.dll /t:library...
1
by: Eric Lindsay | last post by:
I am trying to understand the differences between and uses of persistent, default and alternate styles. I have read http://www.w3.org/TR/REC-html40/present/styles.html section 14.3.2 on...
10
by: James Stroud | last post by:
Hello All, I'm looking for a program to do line-drawings in 3d, with output to postscript or svg or pdf, etc. I would like to describe a scene with certain 1-3d elements oriented in 3d space...
1
by: dowlingm815 | last post by:
Contained within a 2007 database, a report has VBA code for detailed line shading as shown below. However, when a macro executes open report command, the shading does not appear. But appears when...
5
by: colsoft | last post by:
I am using Access 2010. Am generating reports for the records, one record per page. The records on the even pages have a light black background shading which appears when am printing. Please i need...
7
gnawoncents
by: gnawoncents | last post by:
I have a datasheet with alternate row shading and conditional formatting. Unfortunately when the conditional formatting returns true, I lose the alternate row shading for that control. Has...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.