Problem with a continuous form

Straylight

New member
Local time
Today, 00:58
Joined
Feb 21, 2008
Messages
7
Ok so I have code that changes the border color of a form, it is a recordset of Notes for a client. The color changes based on if a person has a checkmark next to a "flagged" checkbox. Since it is a continous form it highlights every record if one is checked. What I want to do it highlight only the "flagged" notes... the code I currently have which works fine is below...

Is this even possible to do on a continuous form?

Public Sub Check_For_Flagged()
Dim i As Integer
Dim Flagged_Found As Boolean
Dim rs As DAO.Recordset
Set rs = Me.Recordset.Clone
For i = 1 To rs.RecordCount
If rs.Fields(6).Value = True Then
Flagged_Found = True
Exit For
End If
Next i
If Flagged_Found Then
Me!NDate.BorderColor = vbRed
Me!NTime.BorderColor = vbRed
Me!NRep.BorderColor = vbRed
Me!NType.BorderColor = vbRed
Me!NNote.BorderColor = vbRed
Else
Me!NDate.BorderColor = vbBlue
Me!NTime.BorderColor = vbBlue
Me!NRep.BorderColor = vbBlue
Me!NType.BorderColor = vbBlue
Me!NNote.BorderColor = vbBlue
End If
End Sub
 
That would be a limitation of continuous forms. Even though Access shows you multiple records, Access only sees one form, so anything outside of a bound field will show the same across all records.
 
if accessXP and later, you can use conditional formatting to help with this.

allows for 3 alternative formatting tests
 

Users who are viewing this thread

Back
Top Bottom