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!

Shading Alternative Records

Status
Not open for further replies.

AmberO

MIS
Oct 17, 2001
37
GB
How can I shade alternative records on a continous form?

record 1 background is white
record 2 background is blue
record 3 background is white ..etc

Thanks in advance for help and ideas.....
 
You could put some code on the "OnCurrent" event of the form...

Dim CurRec as Integer
CurRec = Me.CurrentRecord
If CurRec Mod 2 = 0 Then
Me.Detail.Backcolor = vbBlue
Else
Me.Detail.Backcolor = vbWhite
End If
 
Thank you for the reply - unfortunately it made the background go white for all records until I select the second record and then the background goes blue for all records and so on.

How can I make the page stripey like the replies in this forum? (Sorry, I'm not very good at programming just yet!)

Amber
 
Amber, what version of Access are you using? I know Access 2000 has built-in conditional formating, but I only have '97 here at work, so Ican't tell you how to use it, but maybe that's a direction to go. I've tried to come up with something here in '97, but have had no luck...

Maybe one of our colleagues has an example...?

Sorry I've been of no help, (I missed the "continuous form" part of the original post) I'll keep trying and if I come up with some thing I'll post it right away.

Kyle
 
Hi Kyle,

I'm using access 2000 - I'll look up conditional formating.

Thanks so much for trying to help me!

Amber
 
As far as I know, there is currently no way to format individual records on a continuous form. Any formatting is applied to all records.

However, if you can somehow use a list box instead, you can use a callback function to do individual formatting of list items...
 

If totalrecords = False Then
Detail.BackColor = 16777215
totalrecords = True
Else
totalrecords = False
Detail.BackColor = 12632256
End If

land of milk and Honey
 
whoops forgot the explanation

make a boolean type variable and name it totalrecords (or replace the code above with you custom variable)

this one above makes a nice grey and white alternating record count...

easy on the eyes and professional looking land of milk and Honey
 
ooops that is for a report....

you want it for a form...

let me check land of milk and Honey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top