C
Cheese_whiz
Hi all,
When I run the code below, the first delete string works, but the second one
tells me it won't delete the record because of a 'locking violation'. The
code runs in the beforeupdate event of a main form that is tabbed. The last
tab has a subform that is one-to-one to the main form. That subform is
tabbed. The first tab has just controls housing data from teh recordsource
of that subform, while the other tabs have their own subforms with
one-to-many related data (related to the first tab of the subform).
The records that are successfully deleted are in the 2nd and 3rd tabs of the
subform (in subforms on those tabs). The main record in that subform (on the
first tab) is the one that is failing.
Anyone help?
thanks,
CW
____________________________________
If Me.cmbStatus.OldValue = 3 And Me.cmbStatus.OldValue <> Me.cmbStatus Then
If MsgBox("You are changing the status of a currently marked
'Settled' file to some other " & _
"status classification. This will result in ALL settlement data
and related records being permanently " & _
"removed from the database. Do you wish to continue?", vbYesNo,
"WARNING") = vbYes Then
DoCmd.RunSQL "Delete * From SettlementPayees Where (FileID =
Forms!Files.txtID)"
Forms!Files.subSettlements.Form.Dirty = False
DoCmd.RunSQL "Delete * From Settlements Where (FileID =
Forms!Files.txtID)"
Else
End If
End If
______________________________________________________
When I run the code below, the first delete string works, but the second one
tells me it won't delete the record because of a 'locking violation'. The
code runs in the beforeupdate event of a main form that is tabbed. The last
tab has a subform that is one-to-one to the main form. That subform is
tabbed. The first tab has just controls housing data from teh recordsource
of that subform, while the other tabs have their own subforms with
one-to-many related data (related to the first tab of the subform).
The records that are successfully deleted are in the 2nd and 3rd tabs of the
subform (in subforms on those tabs). The main record in that subform (on the
first tab) is the one that is failing.
Anyone help?
thanks,
CW
____________________________________
If Me.cmbStatus.OldValue = 3 And Me.cmbStatus.OldValue <> Me.cmbStatus Then
If MsgBox("You are changing the status of a currently marked
'Settled' file to some other " & _
"status classification. This will result in ALL settlement data
and related records being permanently " & _
"removed from the database. Do you wish to continue?", vbYesNo,
"WARNING") = vbYes Then
DoCmd.RunSQL "Delete * From SettlementPayees Where (FileID =
Forms!Files.txtID)"
Forms!Files.subSettlements.Form.Dirty = False
DoCmd.RunSQL "Delete * From Settlements Where (FileID =
Forms!Files.txtID)"
Else
End If
End If
______________________________________________________