D
DoveArrow
I'm trying to run the following event, but whenever I have a location
that has active advisors, in addition to running the delete query that
I want it to run, I get an error message that says "Resume Without
Error." What's going on?
Private Sub Inactive_AfterUpdate()
Dim db As Database
Dim rs As Recordset
Dim str As String
Set db = CurrentDb
Set rs = db.OpenRecordset("jtblLocationAdvisor", dbOpenDynaset,
dbSeeChanges)
On Error GoTo Err_Inactive_Click
If Me.Inactive = True Then
rs.MoveFirst
Do Until rs.EOF
If rs![Location ID] = Forms![frmLocationAdvisors]![Location
ID] Then
GoTo Duplicate_Inactive_Click
Else
rs.MoveNext
End If
Loop
End If
Exit_Inactive_Click:
Set db = Nothing
Set rs = Nothing
Exit Sub
Err_Inactive_Click:
MsgBox Err.Description
Resume Exit_Inactive_Click
Duplicate_Inactive_Click:
Select Case MsgBox("There are active advisors listed for this
location. If you wish to delete these advisors from this location,
click OK to continue.", vbOKCancel)
Case vbOK
DoCmd.OpenQuery "qdelLocationAdvisors"
Me.subfrmLocationAdvisors.Requery
Case vbCancel
Me.Inactive = False
End Select
Resume Exit_Inactive_Click
End Sub
that has active advisors, in addition to running the delete query that
I want it to run, I get an error message that says "Resume Without
Error." What's going on?
Private Sub Inactive_AfterUpdate()
Dim db As Database
Dim rs As Recordset
Dim str As String
Set db = CurrentDb
Set rs = db.OpenRecordset("jtblLocationAdvisor", dbOpenDynaset,
dbSeeChanges)
On Error GoTo Err_Inactive_Click
If Me.Inactive = True Then
rs.MoveFirst
Do Until rs.EOF
If rs![Location ID] = Forms![frmLocationAdvisors]![Location
ID] Then
GoTo Duplicate_Inactive_Click
Else
rs.MoveNext
End If
Loop
End If
Exit_Inactive_Click:
Set db = Nothing
Set rs = Nothing
Exit Sub
Err_Inactive_Click:
MsgBox Err.Description
Resume Exit_Inactive_Click
Duplicate_Inactive_Click:
Select Case MsgBox("There are active advisors listed for this
location. If you wish to delete these advisors from this location,
click OK to continue.", vbOKCancel)
Case vbOK
DoCmd.OpenQuery "qdelLocationAdvisors"
Me.subfrmLocationAdvisors.Requery
Case vbCancel
Me.Inactive = False
End Select
Resume Exit_Inactive_Click
End Sub