Option Explicit
Dim LastValue As String
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If LastValue = "S" Then
Me.Surname.BackColor = vbRed
Else
Me.Surname.BackColor = vbWhite
End If
'& "" in case of nulls
LastValue = Me.Surname & ""
End Sub