If have a procedure that searches for duplicate records...
Private Sub_BeforeUpdate(Cancel as Integer)
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("PurchaseOrders", dbOpenTable)
rst.index = "PrimaryKey"
rst.Seek "=", Me!PurchaseOrderNumber
If Not rst.NoMatch Then
MsgBox "PO #" & Me.PurchaseOrderNumber & " has already been issued." & vbCrLf & "Please enter a unique PO #.", vbOKOnly + vbExclamation, "PO Conflict"
DoCmd.RunCommand acCmdUndo
Cancel = True
End If
I need need this to work in a access project (.adp)
Having major trouble. Any help is appreciated.
Private Sub_BeforeUpdate(Cancel as Integer)
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("PurchaseOrders", dbOpenTable)
rst.index = "PrimaryKey"
rst.Seek "=", Me!PurchaseOrderNumber
If Not rst.NoMatch Then
MsgBox "PO #" & Me.PurchaseOrderNumber & " has already been issued." & vbCrLf & "Please enter a unique PO #.", vbOKOnly + vbExclamation, "PO Conflict"
DoCmd.RunCommand acCmdUndo
Cancel = True
End If
I need need this to work in a access project (.adp)
Having major trouble. Any help is appreciated.