You can break a relationship in your database by deleting a record that other data is referring to. For example: In an inventory database, if you delete an inventory item from one table that is referenced in a purchase order record, the purchase order can be invalidated. You can prevent the inventory item from being deleted, by first checking to see if the item is used in a purchase. If is not used anywhere, then it is free to be deleted if you have no need to carry that item in inventory any longer. To accomplish this you need to create a search sql string to check and see if the current productid value is found in any purchases. Private Sub delbtn_Click() On Error GoTo Err_delbtn_Click ' Declare variable set Dim ifid As Long, STRSQL As String, db As Database Dim rec As Recordset, intCounter As Integer 'check to see if record id being used. ifid = Me.ProductID.Value ‘ set the variable name ifid to the value of the current productid value on your form, for example. This is the ‘item you are trying to delete. 'build search query to find if the item is used in any purchase records. ‘The next lines sets the list of fields that are going to be searched from three different tables sellist = " Purchases.PONUM, [Purchase Detail].ProductID, Inventory.ProductName" STRSQL = "SELECT" & sellist STRSQL = STRSQL & " from (Purchases INNER JOIN [Purchase Detail] ON Purchases.Purchaseid = [Purchase Detail].Purchaseid) INNER JOIN Inventory ON [Purchase Detail].ProductID = Inventory.ProductID " STRSQL = STRSQL & "where [Purchase Detail].ProductID = " & ifid STRSQL = STRSQL & " ORDER BY inventory.productName;" ‘debug.print STRSQL ‘ this comes in handy when you are debugging so uncomment to see the actual sql string built from the lines ‘above. Set db = CurrentDb() Set rec = db.OpenRecordset(STRSQL, dbOpenDynaset) intCounter = rec.RecordCount ‘ uncomment the next line if you want to see a message that shows you how many records were found in the id search. 'MsgBox intcounter & " record(s) found" If intCounter = 0 Then retval = MsgBox("Item " & ifid & " was not found in a purchase order, OK to delete?", vbOKCancel) If retval = 1 Then DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70 Else GoTo Exit_delbtn_Click ‘ item was deleted so skip the next msgbox End If Else MsgBox "Item " & rec(2) & " was found in PO " & rec(0) & " It can not be deleted " GoTo Exit_delbtn_Click End If rec.Close Exit_delbtn_Click: Exit Sub Err_delbtn_Click: Debug.Print Err.Number Debug.Print Err.HelpContext Debug.Print Err.Description Resume Exit_delbtn_Click End Sub You will need to have the Microsoft DAO 3.6 reference set for this example. This code is an example only and will not work unless you have the exact field and table names in your forms and tables, so use it as a reference.