I added this line of code for the 'onClick' expression for my delete button:
Code:
Private Sub CMD_DeleteButton_Click()
Dim QI As Integer
QI = MsgBox("Are you sure you want to delete this record?", vbYesNo)
If QI = vbNo Then Exit Sub 'exit routine if user selects No.
DoCmd.SetWarnings False
DoCmd.OpenQuery "MyQueryToAppendTheRecordOnTheFormToAnotherTab le"
'For creating the below vba coding to delete the record, use the wizard since it is different depending on your MSAccess version
'ie. use the wizard to first create a delete button to delete the record (which will have coding similar to that below), and then edit the OnClick() vba code putting in the above coding.
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
'Below is extremely important! You want to make sure you turn on error warnings when done!
DoCmd.SetWarnings True 'Note: to turn back on error checking!! - Important.
End Sub
But when I click on the delete button on my form, I receive the following error (see screenshot)