S
Steve
I have several pairs of synchronized subforms in an application. I have a Delete
button for each pair that uses the following code or similar to delete a record
in the second subform:
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
End If
ExitHere:
Me!SubName.SetFocus
Exit Sub
ErrorHandler:
If Err.Number = 3200 Then
MsgBox Me!SFrmSubcontractorDivisionList!DivisionName & vbCrLf _
& "Can Not Be Deleted From The Database Because There Are" & vbCrLf _
& "One Or More Locations Recorded For The Division.", , "Division Can Not
Be Deleted"
Else
MsgBox Err.Description, , "Error # " & Err.Number
End If
Resume ExitHere
When I try to delete a record that has related records, I get the message for
Err 3200 and all seems to work fine. However, if I then try to move to a
different record in the first subform, I get the error message "Operation Not
Supported In Transactions". There is code in the OnCurrent event of the first
subform:
Me.Parent!SubcontractorDivIDNum = Me!SubcontractorDivID
that synchronozes the subforms and it works error free when navigating through
records in the first subform until I try to delete a record with related records
in the second subform.
Does anyone have any ideas about what is causing the error message?
Thanks!
Steve
button for each pair that uses the following code or similar to delete a record
in the second subform:
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
End If
ExitHere:
Me!SubName.SetFocus
Exit Sub
ErrorHandler:
If Err.Number = 3200 Then
MsgBox Me!SFrmSubcontractorDivisionList!DivisionName & vbCrLf _
& "Can Not Be Deleted From The Database Because There Are" & vbCrLf _
& "One Or More Locations Recorded For The Division.", , "Division Can Not
Be Deleted"
Else
MsgBox Err.Description, , "Error # " & Err.Number
End If
Resume ExitHere
When I try to delete a record that has related records, I get the message for
Err 3200 and all seems to work fine. However, if I then try to move to a
different record in the first subform, I get the error message "Operation Not
Supported In Transactions". There is code in the OnCurrent event of the first
subform:
Me.Parent!SubcontractorDivIDNum = Me!SubcontractorDivID
that synchronozes the subforms and it works error free when navigating through
records in the first subform until I try to delete a record with related records
in the second subform.
Does anyone have any ideas about what is causing the error message?
Thanks!
Steve