SteveL13
asked on
Why getting runtime error 440 - Automation Error
I have the following code in a GroupHeader on print event. But the code stalls and gives me a runtime error 440 - Automation Error. When I debug, this line is highlighted in yellow:
Me.Text35 = Me.Text45 - [Reports]![Income Statement].[Report]![subrp tIncomeSta tementEXPE NSE].[Repo rt]![txtSu mCurrentPe riod]
And when I hover over the Me.Text35 part of that line is indicated Null.
How can I overcome this issue?
Me.Text35 = Me.Text45 - [Reports]![Income Statement].[Report]![subrp
And when I hover over the Me.Text35 part of that line is indicated Null.
How can I overcome this issue?
Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer)
On Error GoTo Err_GroupHeader0_Print
If [Reports]![Income Statement].[Report]![subrptIncomeStatementINCOME].[Report].HasData Then
Me.Text35 = [Reports]![Income Statement].[Report]![subrptIncomeStatementINCOME].[Report]![txtSumCurrentPeriod] - [Reports]![Income Statement].[Report]![subrptIncomeStatementEXPENSE].[Report]![txtSumCurrentPeriod]
Me.Text36 = [Reports]![Income Statement].[Report]![subrptIncomeStatementINCOME].[Report]![txtSumSamePeriodLastYear] - [Reports]![Income Statement].[Report]![subrptIncomeStatementEXPENSE].[Report]![txtSumSamePeriodLastYear]
Me.Text37 = [Reports]![Income Statement].[Report]![subrptIncomeStatementINCOME].[Report]![txtSumYearToDate] - [Reports]![Income Statement].[Report]![subrptIncomeStatementEXPENSE].[Report]![txtSumYearToDate]
Me.Text38 = [Reports]![Income Statement].[Report]![subrptIncomeStatementINCOME].[Report]![txtSumLastYearYearToDate] - [Reports]![Income Statement].[Report]![subrptIncomeStatementEXPENSE].[Report]![txtSumLastYearYearToDate]
Exit Sub
End If
If [Reports]![Income Statement].[Report]![subrptIncomeStatementINCOME].[Report].HasData = False Then
Me.txtCurrentPeriodSumFromExpense = 0
Me.txtSamePeriodFromLastYearFromExpense = 0
Me.txtYearToDateFromExpense = 0
Me.txtYearToDateLastYEarFromExpense = 0
Me.Text45 = 0
Me.Text46 = 0
Me.Text47 = 0
Me.Text48 = 0
Me.Text35 = Me.Text45 - [Reports]![Income Statement].[Report]![subrptIncomeStatementEXPENSE].[Report]![txtSumCurrentPeriod]
Me.Text36 = Me.Text46 - [Reports]![Income Statement].[Report]![subrptIncomeStatementEXPENSE].[Report]![txtSumSamePeriodLastYear]
Me.Text37 = Me.Text47 - [Reports]![Income Statement].[Report]![subrptIncomeStatementEXPENSE].[Report]![txtSumYearToDate]
Me.Text38 = Me.Text48 - [Reports]![Income Statement].[Report]![subrptIncomeStatementEXPENSE].[Report]![txtSumLastYearYearToDate]
End If
Exit_GroupHeader0_Print:
Exit Sub
Err_GroupHeader0_Print:
MsgBox "Error Number: " & Err.Number & vbCrLf & "Error Description: " & Err.Description & vbCrLf & "Error Source: " & Err.Source
Resume Exit_GroupHeader0_Print
End Sub
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you're welcome, Steve ~ happy to help
ASKER