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.
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.