SuperDad
SuperDad

Reputation: 13

restrict("[TaskDueDate] <=" Condition Not Valid

I'm trying to restrict a group of olcontactItems using the TaskDueDate Property I've tried this every way from Sunday, and I keep getting errors. The most recent error is

"Condition not Valid"

I checked to make sure that each of the contacts in the group was markedastask and they all came back true. I'm not sure how to proceed.

If MassEmail.TimeFrame.Value <> "" Then
   Select Case MassEmail.TimeFrame
     Case "Due Today"
        subjFlag = Date

    Case "This Week"
        subjFlag = Date + 7
    Case "Next Week"
        subjFlag = Date + 14
    Case ""
        subjFlag = Date
    Case Else
        subjFlag = Date
End Select
End If
Set supercontacts = allContacts.Restrict("[Categories]=" & myCat & "")
MsgBox supercontacts.Count

If subjFlag <> "" Then
   Set supercontacts = supercontacts.Restrict("[TaskDueDate]<=" & subjFlag &    "")
   MsgBox supercontacts.Count

End If

Upvotes: 1

Views: 162

Answers (0)

Related Questions