Having trouble with the following Sub, It's a CLICK (that closes the Form):
I'm recieving the following error: Application-defined or object-defined error
Private Sub Close_Click()
'Balance Branch Form.Close
On Error GoTo Balance_Branch_Form_Close_Err
With CodeContextObject
If (.Error1 = 1) Then
Beep
MsgBox "One of the ""Differences"" is not equal to $0 so you cannot marked this branch balanced. You must fix this branch so all the ""Differences"" are $0 or mark this branch as ""Branch Not in Balance"".", vbExclamation, ""
Exit Sub
End If
If (.Error2 = 1) Then
Beep
MsgBox "You have indicated this branch is not in balance, so you must enter an explanation in the Comments section.", vbOKOnly, ""
SetFocusComments
Exit Sub
End If
If (Eval("DCount(""[ID]"",""DAILY OUTAGE TICKETS"",""[Branch]=[Form].[BRANCH_RECORD] And [RecoveryType]='Unrecovered' And [LtrDate] Is Null""
<>0 And MsgBox(""You have Unrecovered letters that have not been printed. Would you like to print these now?"",4,""Letter""
=6"
) Then
DoCmd.OpenReport "Daily Outage Tickets Letter", acPreview, "", "[Branch]=[Forms].[Balance Branch].[BRANCH_RECORD] And [RecoveryType]='Unrecovered' And [LtrDate] Is Null"
DoCmd.PrintOut acPrintAll, , , acHigh, 1, True
End If
If (.[Balanced/Research] <> 0) Then
DoCmd.Close acForm, "Balance Branch"
End If
If (.[Balanced/Research] = 0) Then '*** ERROR Happens Right here What's wrong with this line??
'DoCmd.RunMacro "Balance Branch Form.Close2", , ""
If (Eval("MsgBox(""You have not marked this branch as Balanced or Branch Not in Balance. Do you still want to close the form?"",4,""Unbalanced Branch""
=6"
) Then
DoCmd.Close acForm, "Balance Branch"
End If
End If
End With
Balance_Branch_Form_Close_Exit:
Exit Sub
Balance_Branch_Form_Close_Err:
MyErrorHandler ("Form close"
Resume Next
'Resume Balance_Branch_Form_Close_Exit
End Sub
Randall Vollen
National City Bank Corp.
I'm recieving the following error: Application-defined or object-defined error
Private Sub Close_Click()
'Balance Branch Form.Close
On Error GoTo Balance_Branch_Form_Close_Err
With CodeContextObject
If (.Error1 = 1) Then
Beep
MsgBox "One of the ""Differences"" is not equal to $0 so you cannot marked this branch balanced. You must fix this branch so all the ""Differences"" are $0 or mark this branch as ""Branch Not in Balance"".", vbExclamation, ""
Exit Sub
End If
If (.Error2 = 1) Then
Beep
MsgBox "You have indicated this branch is not in balance, so you must enter an explanation in the Comments section.", vbOKOnly, ""
SetFocusComments
Exit Sub
End If
If (Eval("DCount(""[ID]"",""DAILY OUTAGE TICKETS"",""[Branch]=[Form].[BRANCH_RECORD] And [RecoveryType]='Unrecovered' And [LtrDate] Is Null""
DoCmd.OpenReport "Daily Outage Tickets Letter", acPreview, "", "[Branch]=[Forms].[Balance Branch].[BRANCH_RECORD] And [RecoveryType]='Unrecovered' And [LtrDate] Is Null"
DoCmd.PrintOut acPrintAll, , , acHigh, 1, True
End If
If (.[Balanced/Research] <> 0) Then
DoCmd.Close acForm, "Balance Branch"
End If
If (.[Balanced/Research] = 0) Then '*** ERROR Happens Right here What's wrong with this line??
'DoCmd.RunMacro "Balance Branch Form.Close2", , ""
If (Eval("MsgBox(""You have not marked this branch as Balanced or Branch Not in Balance. Do you still want to close the form?"",4,""Unbalanced Branch""
DoCmd.Close acForm, "Balance Branch"
End If
End If
End With
Balance_Branch_Form_Close_Exit:
Exit Sub
Balance_Branch_Form_Close_Err:
MyErrorHandler ("Form close"
Resume Next
'Resume Balance_Branch_Form_Close_Exit
End Sub
Randall Vollen
National City Bank Corp.