Below you'll see the code I'm using in access to generate a number of days diffence based on certain criteria. However, I want to add one other stipulation. I have a checkbox field called Info. If that field called info is not checked, I won't to use the formula below. However, if the box called Info is checked, I do not want this formula to be run and I do not want a day total to populate. In other words, I want this field to be blank if info is checked.
-----------------Code-----------------------
Option Compare Database
Option Explicit
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(Me.Cleared_Code) And IsNull(Me.Inactive_Code) Then
Me.DaysOpen = "(" & DateDiff("d", [Date_Assigned], Date) & "
"
DaysOpen.ForeColor = vbRed
DaysOpen.FontBold = True
Else
Me.DaysOpen = DateDiff("d", [Date_Assigned], [Date_Dispo])
DaysOpen.ForeColor = vbBlack
DaysOpen.FontBold = False
End If
End Sub [sig][/sig]
-----------------Code-----------------------
Option Compare Database
Option Explicit
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(Me.Cleared_Code) And IsNull(Me.Inactive_Code) Then
Me.DaysOpen = "(" & DateDiff("d", [Date_Assigned], Date) & "
DaysOpen.ForeColor = vbRed
DaysOpen.FontBold = True
Else
Me.DaysOpen = DateDiff("d", [Date_Assigned], [Date_Dispo])
DaysOpen.ForeColor = vbBlack
DaysOpen.FontBold = False
End If
End Sub [sig][/sig]