Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change text/background color alternate lines 1

Status
Not open for further replies.

rjpeters

Programmer
Jul 17, 2001
5
AU
So far I have been unable to work out how to change the text (or background) color on alternate lines.
- The report users claim that they cannot follow the lines, so I thought I'd try alternate colors.
There must be a way (at least I hope there is a way) to find which line I'm on.
- Russell Peters
 
Hi

Here are 2 ways

On your form Detail Section On Format event.

**********
Dim greenbar As Boolean

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If greenbar Then
Detail.BackColor = 12181980
Else
Detail.BackColor = vbWhite
End If
greenbar = Not (greenbar)
End Sub
*************
or this way
*************
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

Const WHITE = 16777215
Const YELLOW = 8454143

If (Me![LineNum] Mod 2) = 0 Then
Me![txtOne].BackColor = YELLOW
Me![txtTwo].BackColor = YELLOW
Else
Me![txtOne].BackColor = WHITE
Me![txtTwo].BackColor = WHITE
End If
End Sub
********************
Put an unbround text box on your form and the Control Source is =-1

Cheers
tee




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top