Conditional Formatting not on new record

oxicottin

Learning by pecking away....
Local time
Yesterday, 19:25
Joined
Jun 26, 2007
Messages
888
Hello, I have a continuous form and I'm using Conditional Formatting to color the controls that are not filled in.

Ex: Expression Is = IsNull([txtNetProduct])

But I don't want to color the controls of a NEW record or row unless a record is created. How can I accomplish this?

Thanks!
 
  1. Add a new Yes/No Field to your underlying Table
  2. Name it IsRecord
  3. Add this Field to your Form
  4. Set the Textbox's Visibilty to No
Place this code in your Code Module for the Form

Code:
Private Sub Form_Dirty(Cancel As Integer)
 Me.IsRecord = -1
End Sub

Then, in Conditional Formatting, use

Expression Is : [IsRecord]=-1 And IsNull([txtNetProduct])

Linq ;0)>
 
Worked great thanks!
 
If you have an Autonumber field in your table (e.g. AutoID), instead of...

Expression Is : [IsRecord]=-1 And IsNull([txtNetProduct])

you could use...

Expression Is : NOT IsNull([AutoID]) And IsNull([txtNetProduct])
 

Users who are viewing this thread

Back
Top Bottom