find it:
Code:
Forms!blook_masaleh_frm!unit_sub!IDtxt.SetFocus
Dim delfind, delacc, masID, Eresponse As String
If IsNull(Me.unit_sub.Form.IDtxt) Then
DoCmd.Beep
Else
masID = Me.unit_sub.Form.IDtxt
delfind = DLookup("masaleh_ID", "blook_tolid_tbl", "masaleh_ID='" & masID & "'")
If IsNull(delfind) Then
delacc = MsgBox("delete it?", vbYesNo, "Del")
If delacc = vbYes Then
Me.unit_sub.Form.Recordset.Delete
Me.unit_sub.Form.Recordset.MoveNext
Else
Exit Sub
End If
Else
Eresponse = MsgBox("it's been used", vbCritical, "warning")
End If
End If