N
niuginikiwi
I am getting eror 3075 saying there is a syntax error. I just can't spot the
mistate. Can anyone help?
Here the code behind the form's Before Insert event.
Private Sub Form_BeforeInsert(Cancel As Integer)
'Check for duplicate records
Dim strCriteria As String
strCriteria = "[ProductName]= """ & [Forms]![Products]![ProductName] &
""""
strCriteria = strCriteria & " Or
mistate. Can anyone help?
Here the code behind the form's Before Insert event.
Private Sub Form_BeforeInsert(Cancel As Integer)
'Check for duplicate records
Dim strCriteria As String
strCriteria = "[ProductName]= """ & [Forms]![Products]![ProductName] &
""""
strCriteria = strCriteria & " Or
Code:
= """ & [Forms]![Products]![Code]
& """"
strCriteria = strCriteria & " And [SupplierID]= " &
[Forms]![Products]![cboSupplier].Column(0) & ""
If DCount("*", "qryProductSupplier", strCriteria) >= 1 Then
If MsgBox("This product supplied by the current supplier " & vbCrLf
& " you have selected and is on record " & vbCrLf & "Are you sure you want to
add/edit this code", vbYesNo, "Duplication Check") = vbNo Then
Me.Undo
End If
End If
End Sub