Zebra form (?)

  • Thread starter Thread starter Paulo Ferreira
  • Start date Start date
P

Paulo Ferreira

Hi,

Can someone tell me how to create a "zebra form" (?) based on a field value.
Thanks.

Paulo Ferreira
 
What I want to do is a continuous form where a certain field will have the
same backcolor while it's value is the same.
 
Still not sure what that means, but it sounds like you would use
"conditional formatting" in the Format menu if you want to set a color based
on a field's value or based on the results of a formula.
 
On the data line of your report place a Rectangle Object (in the code below it
is Rect1)

Option Compare Database
Dim LineCount As Integer
Private Sub Report_Activate()
'You will have to insert your own code here to adjust
' the width of the Rect1 Object to fit your own controls
With Rect1
.Width = (Me.Deposit.Left - .Left) + Me.Deposit.Width + 36
.Left = Me.ActivityDate.Left - 18
.Height = Me.Detail.Height
End With
End Sub

'in this sub you will have to insert your own color values to suit
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
LineCount = LineCount + 1
If LineCount Mod 2 = 0 Then
Rect1.BackColor = 13816530
Else
Rect1.BackColor = 16777215
End If
End Sub
 
Maybe "zebra" isn't the correct name but you may know what it would do if it
was a report.
Then I would have a gray line followed by a white one, then a gray, then...
So, I want that kind of result on a continuous form that would have a lot of
diferent records, ordered by a specific field. As that field value could be
the same for 2 records and after that I could have have another 2 or 3 with
a different value and so on, conditional formatting wont be the solution.
I have some dificulties with english but I hope you understand what I want.
Thanks.

Paulo Ferreira
 
Thanks anyway.
Maybe you would like to read my last comment to better understand what I
need.
Paulo Ferreira
 
Paulo Ferreira said:
Maybe "zebra" isn't the correct name but you may know what it would do
if it was a report.
Then I would have a gray line followed by a white one, then a gray,
then... So, I want that kind of result on a continuous form that would
have a lot of diferent records, ordered by a specific field. As that
field value could be the same for 2 records and after that I could
have have another 2 or 3 with a different value and so on, conditional
formatting wont be the solution. I have some dificulties with english
but I hope you understand what I want. Thanks.

Paulo Ferreira

Hi Paulo,

Maybe this link to Stephan Lebans site will help.

http://www.lebans.com/conditionalformatting.htm

By the way, your English is just fine. It is one heck-of-a-lot
better than my Italian or Spanish.

Hope that helps!
 
Back
Top