-
Try this. It formats the textbox after information is inputted. It requires that you have another control (textbox, combobox, etc.) on your form:
[vba]
Private Sub txtActiveto_AfterUpdate()
Dim CurrDate As Date
CurrDate = Now - 1
If txtActiveto < CurrDate Then
txtActiveto.BackColor = vbRed
Else: txtActiveto.BackColor = vbWhite
End If
End Sub
[/vba]
As for colors, check out this site:
http://www.mvps.org/dmcritchie/excel/colors.htm
[vba]txtActiveto.BackColor = RGB(255, 0, 0)[/vba]
gives you the same as
[vba]
txtActiveto.BackColor = vbRed [/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules