J
Joy
I have this code to idnetify when possible duplicate
records are being entered. As you can see the code looks
for a match on these two fields:
[InsPolicyOrAcctNo] and "[CaseTypeID]
My situatjion is this, I need to add to the criteria to
look back at only those records received in the past 30
days. I have a field [DateReceived] and I'm just not sure
where I would put the criteria of >Date()-30. Any
suggestoins on how I could accomplish this/ Thank you
Private Sub InsPolicyOrAcctNo_AfterUpdate()
Dim strExistingCaseID As String
strExistingCaseID = Nz(DLookup
("[CaseID]", "tblCases", "[CaseTypeID]=" & Me.CaseTypeID
& " AND [InsPolicyOrAcctNo]='" & Me.InsPolicyOrAcctNo
& "'"), "")
If strExistingCaseID <> "" Then
MsgBox "A possible duplicate case was created on "
& DLookup("[DateReceived]", "tblCases", "[CaseID]='" &
strExistingCaseID & "'") & "." & vbCrLf & vbCrLf & "Please
refer to this case ID: " & strExistingCaseID, vbOKOnly +
vbExclamation, "Warning"
End If
End Sub
records are being entered. As you can see the code looks
for a match on these two fields:
[InsPolicyOrAcctNo] and "[CaseTypeID]
My situatjion is this, I need to add to the criteria to
look back at only those records received in the past 30
days. I have a field [DateReceived] and I'm just not sure
where I would put the criteria of >Date()-30. Any
suggestoins on how I could accomplish this/ Thank you
Private Sub InsPolicyOrAcctNo_AfterUpdate()
Dim strExistingCaseID As String
strExistingCaseID = Nz(DLookup
("[CaseID]", "tblCases", "[CaseTypeID]=" & Me.CaseTypeID
& " AND [InsPolicyOrAcctNo]='" & Me.InsPolicyOrAcctNo
& "'"), "")
If strExistingCaseID <> "" Then
MsgBox "A possible duplicate case was created on "
& DLookup("[DateReceived]", "tblCases", "[CaseID]='" &
strExistingCaseID & "'") & "." & vbCrLf & vbCrLf & "Please
refer to this case ID: " & strExistingCaseID, vbOKOnly +
vbExclamation, "Warning"
End If
End Sub