Ok - I think I made the changes that you suggested but sadly I am still getting inconsistent results. Here is the updated code - any other suggestions on whatt I need to change to make this work?
For example: I have one with a Percentage variance of 6% (should score 2) and 5 fails (score of 1) = (2+1)/2 = 1.5 but instead I get 2.5
Code:
Private Sub CalculateScore_Click()
Dim target_control As Control
Dim control_Value As Integer
Dim control_Count As Integer
Dim UserID
Dim nVar As Single, nVar2 As Single
nVar1 = Round(txtPercentDeviation, 2)
UserID = Environ("UserName")
Me.txtOver = DimenstionsOver + QuantityOver + RepairReplaceOver + PricingOver + Overhead_ProfitOver + LumpSumOver + ConsiderationsOver + DepreciationOver
Me.txtUnder = DimenstionsUnder + QuantityUnder + RepairReplaceUnder + PricingUnder + Overhead_ProfitUnder + LumpSumUnder + ConsiderationsUnder + DepreciationUnder
If IsNull(Me.txtDateReInspected.Value) = False Then
'do nothing
Else
If IsNull(Me.txtDateReInspected.Value) = True Then
Me.txtDateReInspected.Value = Date
End If
End If
control_Value = 0
control_Count = 0
For Each target_control In Me.Controls
Select Case target_control.Name
Case "cboPhysicalReview", "cboReviewOf"
Case Else
If TypeName(target_control) = "ComboBox" Then
If Not target_control.Value = "Yes" Then
control_Value = control_Value + 1
control_Count = control_Count + 1
End If
End If
End Select
Next
txtFails = control_Value
Select Case nVar1
Case 0 To 0.05
txtDeviationScore = 3
Case 0.06 To 0.15
txtDeviationScore = 2
Case 0.16 To 0.49
txtDeviationScore = 1
Case Else
txtDeviationScore = 0
End Select
Select Case nVar2
Case Is <= 1
txtDifferenceScore = 3
Case 2 To 3
txtDifferenceScore = 2
Case 4 To 5
txtDifferenceScore = 1
Case Else
txtDifferenceScore = 0
End Select
Score = (txtDeviationScore + txtDifferenceScore) / 2
For Each target_control In Me.Controls
If TypeName(c) = "ComboBox" Then
If target_control.Value = "" Then na = MsgBox("All dropdown boxes must be filled out before continuing. Please choose Yes, No, Partially or N/A before continuing.", vbOKOnly, "Quarterly Audits")
End If
Next target_control
End Sub
Thank you so much for helping!