D
deb
1) What am I doing wrong?
Want to display dupe msg if ([ContactSubID]= 48 and [Current] = Yes) or
[ContactSubID]= 49 and [Current] = Yes)
2) should this go in before update of ContactSubID and Current or the form?
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset '
Set rsc = Me.RecordsetClone
stLinkCriteria = "([ContactSubID]= 48 or [ContactSubID]= 49 and
[Current] = Yes)"
'Check table for duplicate ID
If DCount("ContactSubID", "t41ContactsProj ", stLinkCriteria) > 0 Then
'Undo duplicate entry
Me.Undo
'Message box warning of duplication
MsgBox "Warning Current Manager was previously entered." _
& vbCr & vbCr & "Verify and make changes(as needed).", _
vbInformation, "Duplicate Information"
End If
Set rsc = Nothing
End Sub
Want to display dupe msg if ([ContactSubID]= 48 and [Current] = Yes) or
[ContactSubID]= 49 and [Current] = Yes)
2) should this go in before update of ContactSubID and Current or the form?
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset '
Set rsc = Me.RecordsetClone
stLinkCriteria = "([ContactSubID]= 48 or [ContactSubID]= 49 and
[Current] = Yes)"
'Check table for duplicate ID
If DCount("ContactSubID", "t41ContactsProj ", stLinkCriteria) > 0 Then
'Undo duplicate entry
Me.Undo
'Message box warning of duplication
MsgBox "Warning Current Manager was previously entered." _
& vbCr & vbCr & "Verify and make changes(as needed).", _
vbInformation, "Duplicate Information"
End If
Set rsc = Nothing
End Sub