Conditional Formatting not on new record (1 Viewer)

oxicottin

Learning by pecking away....
Local time
Yesterday, 19:59
Joined
Jun 26, 2007
Messages
856
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!
 

missinglinq

AWF VIP
Local time
Yesterday, 19:59
Joined
Jun 20, 2003
Messages
6,423
  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)>
 

oxicottin

Learning by pecking away....
Local time
Yesterday, 19:59
Joined
Jun 26, 2007
Messages
856
Worked great thanks!
 

The John Rambo

Baggins
Local time
Today, 02:59
Joined
Apr 7, 2011
Messages
19
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

Top Bottom