New record

7625965

New member
Local time
Today, 09:50
Joined
Jan 5, 2010
Messages
5
Hi.
I use some conditional formating on my form (red textbox backcolor when it is empty), but I don't want it when I open the new record. How do I do it? Thanks!
 
Hi;

Do not use conditional formatting to it, use:

Private Sub Form_Current()
If IsNull(Me.YouTextbox) Or Me.YouTextbox = "" Then
Me.YouTextbox.BackColor = RGB(255, 0, 0)
Else
Me.YouTextbox.BackColor = RGB(255, 255, 255)
End If
If Me.NewRecord Then
Me.YouTextbox.BackColor = RGB(255, 255, 255)
End If
End Sub
 
When should the textbox turn red? After a record is saved? After a control is updated?
 
Thank you for idea, JPaulo!
I added "if Not Me.NewRecord Then ...."
and all my code now works just fine. Thanks again.
 
Thanks for responding, you can serve others with the same doubts.
 

Users who are viewing this thread

Back
Top Bottom