delete record in a main form and any link records in the subform
- From: "hngo" <hngo@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 20 Jul 2005 23:22:01 -0700
my problems is that if the subform dont have any record the system return
with a MICROSOFT OFFICE ACCESS MESSAGE - "NO CURRENT REORD"
CLICK "OK"
however the system does not delete the record in the mainform. Can anyone
help?
My coding is as follows:
Private Sub Delete_equipment_Click()
On Error GoTo Err_Delete_equipment_Click
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "you are about to IRREVERSIBLY DELETE *ALL*INFORMATION CONCERNING
THIS MAIN EQUIPMENT FROM THE DATABASE!?" ' Define message.
Style = vbOKCancel + vbCritical + vbDefaultButton2 ' Define buttons.
Title = "ARE YOU 100% SURE!!!?" ' Define title.
Response = MsgBox(Msg, Style, Title)
If Response = vbOK Then ' User chose Ok.
Me.AllowDeletions = True
Me.FORM_conveyor_data.Form.Recordset.Delete
'Me.Form_Brake.Form.Recordset.Delete
'Me.Form_Backstop.Form.Recordset.Delete
'Me.Form_Coupling.Form.Recordset.Delete
'Me.Form_CV_GearBox.Form.Recordset.Delete
'Me.FORM_CV_pulley.Form.Recordset.Delete
'Me.Form_motor_equipment.Form.Recordset.Delete
'Me.Form_Instrumentation.Form.Recordset.Delete
Me.[sub equipment details].Form.Recordset.Delete
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
End If
Exit_Delete_equipment_Click:
Exit Sub
Err_Delete_equipment_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Delete_equipment_Click
End Sub
Many thanks in advance
.
- Follow-Ups:
- Re: delete record in a main form and any link records in the subform
- From: Dirk Goldgar
- Re: delete record in a main form and any link records in the subform
- Prev by Date: Re: List Box length is limited?
- Next by Date: Re: List Box length is limited?
- Previous by thread: Use "Like" function in conditional formatting on form.
- Next by thread: Re: delete record in a main form and any link records in the subform
- Index(es):