Access 2003:
The following code is intended to delete the current record and all child records but results in an error, help please, thx.
Private Sub CmdDelBSR_Click ()
On Error GoTo Err_CmdDelBSR_C lick
Dim strSQL As String
DoCmd.SetWarnin gs (False)
strSQL = "delete from bsr_offers_T where bsr_id = " & Me.BSR_ID
DoCmd.RunSQL strSQL
strSQL = "delete from bsr_price_plan_ T where bsr_id = " & Me.BSR_ID
DoCmd.RunSQL strSQL
strSQL = "delete from bsr_attachments where bsr_id = " & Me.BSR_ID
DoCmd.RunSQL strSQL
strSQL = "delete from bsr_t where bsr_id = " & Me.BSR_ID
DoCmd.RunSQL strSQL
DoCmd.Requery '<== this line produces the error "Microsoft Access Can't find the field "|" refered to in your expression
DoCmd.GoToRecor d , , acFirst '<== error message Goto not available if I dont have the requery line
DoCmd.SetWarnin gs (True)
Exit_CmdDelBSR_ Click:
Exit Sub
Err_CmdDelBSR_C lick:
MsgBox Err.Description
Resume Exit_CmdDelBSR_ Click
End Sub
The following code is intended to delete the current record and all child records but results in an error, help please, thx.
Private Sub CmdDelBSR_Click ()
On Error GoTo Err_CmdDelBSR_C lick
Dim strSQL As String
DoCmd.SetWarnin gs (False)
strSQL = "delete from bsr_offers_T where bsr_id = " & Me.BSR_ID
DoCmd.RunSQL strSQL
strSQL = "delete from bsr_price_plan_ T where bsr_id = " & Me.BSR_ID
DoCmd.RunSQL strSQL
strSQL = "delete from bsr_attachments where bsr_id = " & Me.BSR_ID
DoCmd.RunSQL strSQL
strSQL = "delete from bsr_t where bsr_id = " & Me.BSR_ID
DoCmd.RunSQL strSQL
DoCmd.Requery '<== this line produces the error "Microsoft Access Can't find the field "|" refered to in your expression
DoCmd.GoToRecor d , , acFirst '<== error message Goto not available if I dont have the requery line
DoCmd.SetWarnin gs (True)
Exit_CmdDelBSR_ Click:
Exit Sub
Err_CmdDelBSR_C lick:
MsgBox Err.Description
Resume Exit_CmdDelBSR_ Click
End Sub
Comment