La siguiente función colorea el borde de un text box, un list box o un combobox. La función permite activar o desactivar el marcado del borde del control, así como seleccionar el color dependiendo del grado de necesidad de que dicho control contenga datos.

Se puede utilizar tanto en código, de la siguiente forma:
x = BorderHighlightField(Me.txtOne, True)
x = BorderHighlightField(Me.txtOne, True, “Alert”)
O en un evento del control:
=BorderHighlightField(Forms!BorderHighlightExample_frm!txtName,True)
Function BorderHighlightField(ctlIn As Control, fOnOff As Boolean, Optional strPurpose As String) As Boolean
On Error GoTo MyErr
Dim lngColor As Long
Dim bOK As Boolean
bOK = False
Const kIntSunken As Long = 2
Select Case strPurpose
Case "Alert"
lngColor = RGB(196, 6, 39) 'Red
Case "Attention"
lngColor = RGB(255, 140, 0) 'Orange
Case Else
lngColor = RGB(80, 139, 228) 'Blue
End Select
If fOnOff = True Then 'make the control border highlighted
ctlIn.SpecialEffect = 0
ctlIn.BorderStyle = 1
ctlIn.BorderWidth = 2
ctlIn.BorderColor = lngColor
Else
ctlIn.BorderStyle = 0
ctlIn.SpecialEffect = kIntSunken 'could use another style, e.g. flat
End If
bOK = True
MyExit:
On Error Resume Next
BorderHighlightField = bOK
Exit Function
MyErr:
Resume MyExit
End Function
Descargar: Access 2000
Fuente: David Plaut