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
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