delete record without msgbox for deleting cascading records

deb

Active Member
Joined
Feb 1, 2003
Messages
400
I have a form with a sub form that has a button to copy the displayed form and subform. Users can then change date and make edits if needed for their current monthly reports.
If the date is not changed it will delete the record on close. However it
prompts me if I want to delete the cascading record. How can I delete the record with out the prompt? I want it to delete without the user knowing anything is deleted.

Or is there a way to just say yes to the delete, using code, so the user does not see the msg box?

The below code is what I am using in the Unload form event.

DoCmd.SetWarnings False

If Me.ReportDt = 1 Then
Me.AllowEdits = True
Forms!f4KPIEdit.Form!f4KPIEditDetails.Form.AllowEdits = True
Me.AllowDeletions = True
Forms!f4KPIEdit.Form!f4KPIEditDetails.Form.AllowDeletions = True
' Me.Undo
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
End If

DoCmd.SetWarnings True

Thanks in advance
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,214,983
Messages
6,122,595
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top