The Delete code not executing

Tom d

Member
Local time
Yesterday, 23:34
Joined
Jul 12, 2022
Messages
80
The Delete code executes for The "Add/Delete Author Form", but does not execute for the "Add/ Delete Binding form.I must be missing some thing.
 

Attachments

Why not just show the code to start off with? :(
Then we can ask for a db if needed?
 
Why not just show the code to start off with? :(
Then we can ask for a db if needed?
The code does not execute when the delete button is pressed and a record is selected from the combo Box. It executes for the add delete author button, it is the same code as the Author code, but it is not being executed. I added a msgbox to the code but it never shows up. Looking at the delete code will not solve the problem because it never get executed.

Private Sub Delete_But_Click()
Dim Reply As Variant
Reply = MsgBox("THIS ACTION DELETES THIS RECORD." & Chr(10) & Chr(10) & "DO YOU WANT TO DO THIS?", vbYesNo)
If Reply = 7 Then 'NO
DoCmd.CancelEvent
Exit Sub
End If
If Reply = 6 Then 'Yes
DoCmd.OpenQuery "DeleteBinding", acViewNormal, acReadOnly
Me.Requery
Me.Recalc
End If
Exit Sub
End Sub
 
Last edited:
Is that code tied to the event of the button?
A simple breakpoint would show that, but as you say no MSGBOX is shown, that is the likely cause.

This seems to confirm it? :(
1731017399633.png
 

Users who are viewing this thread

Back
Top Bottom