I have 3 textboxes and 1 combobox.
txtpresence = calculated via other textboxes
txtProduction = enters by user
cboScore = 0 -25 selected by user
txtEfficiency = populated with summation result
It gives error on this line for cboScore declarationCode:Private Sub txtPresence_Change() If Me.txtPresence.Value <> vbNullString Then If IsNumeric(Me.txtPresence.Value) = True Then If Me.txtProduction.Value <> vbNullString Then If IsNumeric(Me.txtProduction.Value) = True Then If Me.cboScore.Value <> vbNullString Then If IsNumeric(Me.cboScore.Value) = True Then Me.txtEfficiency.Value = [CDbl(Me.txtProduction.Value) / CDbl(Me.txtPresence.Value) * 75] + CDbl(Me.cboScore.Value) End If End If End If End If End If End If End Sub Private Sub txtProduction_Change() If Me.txtProduction.Value <> vbNullString Then If IsNumeric(Me.txtProduction.Value) = True Then If Me.txtPresence.Value <> vbNullString Then If IsNumeric(Me.txtPresence.Value) = True Then If Me.cboScore.Value <> vbNullString Then If IsNumeric(Me.cboScore.Value) = True Then Me.txtEfficiency.Value = [CDbl(Me.txtProduction.Value) / CDbl(Me.txtPresence.Value) * 75] + CDbl(Me.cboScore.Value) End If End If End If End If End If End If End Sub Private Sub cboScore_Change() If Me.cboScore.Value <> vbNullString Then If IsNumeric(Me.cboScore.Value) = True Then If Me.txtPresence.Value <> vbNullString Then If IsNumeric(Me.txtPresence.Value) = True Then If Me.txtProduction.Value <> vbNullString Then If IsNumeric(Me.txtProduction.Value) = True Then Me.txtEfficiency.Value = [CDbl(Me.txtProduction.Value) / CDbl(Me.txtPresence.Value) * 75] + CDbl(Me.cboScore.Value) End If End If End If End If End If End If End Sub
Should i use another term instead of CDbl(Me.cboScore.value) or there's something else wrong in my code?Code:Me.txtEfficiency.Value = [CDbl(Me.txtProduction.Value) / CDbl(Me.txtPresence.Value) * 75] + CDbl(Me.cboScore.Value)




Reply With Quote
