We just upgraded to Office 2010 from 2003 and I am now getting 'invalid use of null' after choosing a valid combo box option. When I debug, the line that highlights has to do with a text box on the form rather than the combo box. Here's the code highlighting:
frmLines = Me.WorkLoadUnit
This is the code in it's entirety.
Private Sub fsubProductivityInput_Calculations()
On Error GoTo err
'Calculate Breaks and Net Hours
Dim frmLines As Double
Dim frmHours As Double
Dim frmLPH As Double
frmLines = Me.WorkLoadUnit
frmHours = Me.Hours
'Calculate Lines Per Hour
frmLPH = (frmLines / frmHours)
'Set Feild
Me.AveragePerformanceResults = frmLPH
'Calculate % to Average
Dim frmHighPerformanceResults As Double
Dim frmAnticipatedPerformanceResults As Double
Dim frmLowPerformanceResults As Double
Dim frmSpread As Variant
Dim frmAveragePercent As Double
'Pulls the numbers out of the combo box and place them in the subform'''''''''''''''''''''''''''
frmHighPerformanceResults = [HighPerformanceResults]
frmAnticipatedPerformanceResults = [AnticipatedPerformanceResults]
frmLowPerformanceResults = [LowPerformanceResults]
'Calculate Spread and % to Average
frmSpread = frmHighPerformanceResults - frmAnticipatedPerformanceResults
frmAveragePercent = ((frmLPH - frmAnticipatedPerformanceResults) / frmSpread)
'Set Feild
Me.AveragePercent = frmAveragePercent
Exit_Err:
Exit Sub
err:
'DoCmd.beep
'MsgBox err.Description
'MsgBox "Please enter the number of Lines performed on this task", , "Possible Mistake"
'Me.WorkLoadUnit.SetFocus
Resume Exit_Err
End Sub
Any thoughts/suggestions?
frmLines = Me.WorkLoadUnit
This is the code in it's entirety.
Private Sub fsubProductivityInput_Calculations()
On Error GoTo err
'Calculate Breaks and Net Hours
Dim frmLines As Double
Dim frmHours As Double
Dim frmLPH As Double
frmLines = Me.WorkLoadUnit
frmHours = Me.Hours
'Calculate Lines Per Hour
frmLPH = (frmLines / frmHours)
'Set Feild
Me.AveragePerformanceResults = frmLPH
'Calculate % to Average
Dim frmHighPerformanceResults As Double
Dim frmAnticipatedPerformanceResults As Double
Dim frmLowPerformanceResults As Double
Dim frmSpread As Variant
Dim frmAveragePercent As Double
'Pulls the numbers out of the combo box and place them in the subform'''''''''''''''''''''''''''
frmHighPerformanceResults = [HighPerformanceResults]
frmAnticipatedPerformanceResults = [AnticipatedPerformanceResults]
frmLowPerformanceResults = [LowPerformanceResults]
'Calculate Spread and % to Average
frmSpread = frmHighPerformanceResults - frmAnticipatedPerformanceResults
frmAveragePercent = ((frmLPH - frmAnticipatedPerformanceResults) / frmSpread)
'Set Feild
Me.AveragePercent = frmAveragePercent
Exit_Err:
Exit Sub
err:
'DoCmd.beep
'MsgBox err.Description
'MsgBox "Please enter the number of Lines performed on this task", , "Possible Mistake"
'Me.WorkLoadUnit.SetFocus
Resume Exit_Err
End Sub
Any thoughts/suggestions?