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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Background colour in a continuous form

Status
Not open for further replies.

greymonkey

Technical User
Jul 20, 2003
29
AU
Hi there,

I have a subform which is showing the records in continuous forms.

i am trying to get the background colour to alternate between records so you get a sort of stripy efect.

all my efforts so far just change the background colour for every record.

any ideas.

cheers,
GrayMonkey
:>
 
Try this:

Private Sub Form_Current()
MyColor = Int((255 * Rnd) + 1)
MyColor1 = Int((255 * Rnd) + 1)
MyColor2 = Int((255 * Rnd) + 1)
Detail.BackColor = RGB(MyColor, MyColor1, MyColor2)
End Sub

Putting the color change in the Form_Current() section causes the color to change on form opening and when displaying new records. That's from "BackColor Property" in Access help.

Hope that helps.



DreamerZ
simplesolutions@prodigy.net
[ignore][/ignore]
 
Hi greymonkey,

While there is no obvious solution there is one and it takes a little bit of work to implement but it is easy to do. I found an example db on the net for download some time ago, which is how I learned to do this. Follow the below link and download the ColorCon.zip and it will show and explain to you how to do this. Hope this helps.



Regards,
gkprogrammer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top