Alternating Line Colors

  • Thread starter Thread starter Burt
  • Start date Start date
B

Burt

Hi,

I am creating an adp program. I am looking for a way to
alternate colors in a datasheet view of a table.
Specifically, have one line light yellow, the next white,
then light yellow again.

I know how to do this within an mdb database, however,
when I transafered the code into the adp project all I got
was all yellow lines.

If possible please advise.

Thanks in advance for any help or direction,

Burt
 
Burt said:
Hi,

I am creating an adp program. I am looking for a way to
alternate colors in a datasheet view of a table.
Specifically, have one line light yellow, the next white,
then light yellow again.

I know how to do this within an mdb database, however,
when I transafered the code into the adp project all I got
was all yellow lines.

If possible please advise.

Thanks in advance for any help or direction,

Burt

http://www.comriesoftware.net/codewidgets/product.aspx?key=146
 
I've been using this one for about 10 years now:

Declare two constants in the declarations section of your report module:

Const GREY = 12632256
Const WHITE = 16777215

Then in the detail section, put the following code. in this example the only
fields are phone and name, but in your report you need to specify all the
fields and change their back color property.

Sub Detail1_Print (Cancel As Integer, PrintCount As Integer)
Static ShadeOnOff As Integer

If ShadeOnOff = True Then
Me.section(0).backcolor = GREY
Me![phone].backcolor = GREY
Me![name].backcolor = GREY

Else
Me.section(0).backcolor = WHITE
Me![phone].backcolor = WHITE
Me![name].backcolor = WHITE
End If

ShadeOnOff = Not ShadeOnOff

End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top