Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[blue] Dim Cri As String
Cri = "[File Name] = '" & Me![File Name] & "' AND " & _
"[Vendor Name] = '" & Me![Vendor Name] & "' AND " & _
"[Amount Due] = " & Me![Amount Due]
If Not IsNull(DLookup("[PrimaryKeyName]", "TableName", Cri)) Then
MsgBox "Duplicate Record Found!", _
vbCritical + vbOKOnly, _
"Duplicate Detected! . . ."
Cancel = True
End If[/blue]
The message should pop-up as soon as you attempt to goto another record. Also when you click [blue]OK[/blue] in the messagebox you should return to the record you were editing ... still in edit mode.nala1 said:[blue] ... when I first enter the duplicate record nothing happens and [purple]I am able to proceed to the next record.[/purple][/blue]
[blue] Dim Cri As String
Cri = "[[purple][b]File Name[/b][/purple]] = '" & Me![[purple][b]File Name[/b][/purple]] & "' AND " & _
"[[purple][b]Vendor Name[/b][/purple]] = '" & Me![[purple][b]Vendor Name[/b][/purple]] & "' AND " & _
"[[purple][b]Amount Due[/b][/purple]] = " & Me![[purple][b]Amount Due[/b][/purple]]
If Not IsNull(DLookup("[[purple][b]PrimaryKeyName[/b][/purple]]", "[purple][b]TableName[/b][/purple]", Cri)) Then
MsgBox "Duplicate Record Found!", _
vbCritical + vbOKOnly, _
"Duplicate Detected! . . ."
Cancel = True
End If[/blue]
Just remove the [blue]Cancel = True[/blue] line.nala1 said:[blue]NOW - I would like to add the records regardless ...[/blue]