Changing back colour

Kempes

Registered User.
Local time
Today, 06:17
Joined
Oct 7, 2004
Messages
327
I have a form that shows records in continuoes format.

There is a field on the form currently called [Text10] which holds a status of "Loan" and "On Loan".

I need the back colour to change green if the status is "Loan" and Red if the status is "On Loan".

My code so,

Private Sub Form_Current()

Dim LngGreen As Long, LngRed As Long

LngGreen = RGB(128, 255, 128)
LngRed = RGB(255, 128, 128)

If [Text10] = "Loan" Then
[Text10].BackColor = LngGreen
ElseIf [Text10] = "On Loan" Then
[Text10].BackColor = LngRed
End If


End Sub

This works if you display the form in single view mode, but I need it in continuoes which only changes the colour when you select the record, but it changes all records, not the one it relates to.

If anyone can help, I would appreciate it.
 
you can do that with conditional formatting. In you form go to Format Menu and choose Conditional Formatting.
 
Where is this in Access 97?

I can't seem to find it
 
i am using access 2000, not sure if it's available in access 97 as well, since i do not have it installed.
 
Access 97 does not have conditional formatting. I have seen code posted somewhere that will simulate it but it was a lot of code and looked to be more trouble than it was worth.
 
Ok.

Thanks for the replies. I may just ditch this idea for now.
 

Users who are viewing this thread

Back
Top Bottom