L
LDMueller
I can write a little vba code, but I'm not proficient enough to always write
it the most simpliest way. Can anyone help me simplify this code.
Private Sub cmdtest_Click()
If Me.cboQualityWorkProduct < 0.6 Then
Me.txtQualityWorkProduct = "0 - Not Observed"
Else
If Me.cboQualityWorkProduct > 0.5 And Me.cboQualityWorkProduct < 1.6 Then
Me.txtQualityWorkProduct = "1 - Does Not Meet SP Expectations"
Else
If Me.cboQualityWorkProduct > 1.5 And Me.cboQualityWorkProduct < 2.6 Then
Me.txtQualityWorkProduct = "2 - Does Not Meet SP Expectations"
Else
If Me.cboQualityWorkProduct > 2.5 And Me.cboQualityWorkProduct < 3.6 Then
Me.txtQualityWorkProduct = "3 - Meets SP Expectations"
Else
If Me.cboQualityWorkProduct > 3.5 And Me.cboQualityWorkProduct < 4.6 Then
Me.txtQualityWorkProduct = "4 - Meets SP Expectations"
Else
If Me.cboQualityWorkProduct > 4.5 And Me.cboQualityWorkProduct < 5.6 Then
Me.txtQualityWorkProduct = "5 - Meets SP Expectations"
Else
If Me.cboQualityWorkProduct > 5.5 And Me.cboQualityWorkProduct < 6.6 Then
Me.txtQualityWorkProduct = "6 - Exceeds SP Expectations"
Else
If Me.cboQualityWorkProduct > 6.5 And Me.cboQualityWorkProduct < 7.6 Then
Me.txtQualityWorkProduct = "7 - Exceeds SP Expectations"
End If
End If
End If
End If
End If
End If
End If
End If
If Me.cboProductivity < 0.6 Then
Me.txtProductivity = "0 - Not Observed"
Else
If Me.cboProductivity > 0.5 And Me.cboProductivity < 1.6 Then
Me.txtProductivity = "1 - Does Not Meet SP Expectations"
Else
If Me.cboProductivity > 1.5 And Me.cboProductivity < 2.6 Then
Me.txtProductivity = "2 - Does Not Meet SP Expectations"
Else
If Me.cboProductivity > 2.5 And Me.cboProductivity < 3.6 Then
Me.txtProductivity = "3 - Meets SP Expectations"
Else
If Me.cboProductivity > 3.5 And Me.cboProductivity < 4.6 Then
Me.txtProductivity = "4 - Meets SP Expectations"
Else
If Me.cboProductivity > 4.5 And Me.cboProductivity < 5.6 Then
Me.txtProductivity = "5 - Meets SP Expectations"
Else
If Me.cboProductivity > 5.5 And Me.cboProductivity < 6.6 Then
Me.txtProductivity = "6 - Exceeds SP Expectations"
Else
If Me.cboProductivity > 6.5 And Me.cboProductivity < 7.6 Then
Me.txtProductivity = "7 - Exceeds SP Expectations"
End If
End If
End If
End If
End If
End If
End If
End If
If Me.cboEfficiency < 0.6 Then
Me.txtEfficiency = "0 - Not Observed"
Else
If Me.cboEfficiency > 0.5 And Me.cboEfficiency < 1.6 Then
Me.txtEfficiency = "1 - Does Not Meet SP Expectations"
Else
If Me.cboEfficiency > 1.5 And Me.cboEfficiency < 2.6 Then
Me.txtEfficiency = "2 - Does Not Meet SP Expectations"
Else
If Me.cboEfficiency > 2.5 And Me.cboEfficiency < 3.6 Then
Me.txtEfficiency = "3 - Meets SP Expectations"
Else
If Me.cboEfficiency > 3.5 And Me.cboEfficiency < 4.6 Then
Me.txtEfficiency = "4 - Meets SP Expectations"
Else
If Me.cboEfficiency > 4.5 And Me.cboEfficiency < 5.6 Then
Me.txtEfficiency = "5 - Meets SP Expectations"
Else
If Me.cboEfficiency > 5.5 And Me.cboEfficiency < 6.6 Then
Me.txtEfficiency = "6 - Exceeds SP Expectations"
Else
If Me.cboEfficiency > 6.5 And Me.cboEfficiency < 7.6 Then
Me.txtEfficiency = "7 - Exceeds SP Expectations"
End If
End If
End If
End If
End If
End If
End If
End If
If Me.cboInitiative < 0.6 Then
Me.txtInitiative = "0 - Not Observed"
Else
If Me.cboInitiative > 0.5 And Me.cboInitiative < 1.6 Then
Me.txtInitiative = "1 - Does Not Meet SP Expectations"
Else
If Me.cboInitiative > 1.5 And Me.cboInitiative < 2.6 Then
Me.txtInitiative = "2 - Does Not Meet SP Expectations"
Else
If Me.cboInitiative > 2.5 And Me.cboInitiative < 3.6 Then
Me.txtInitiative = "3 - Meets SP Expectations"
Else
If Me.cboInitiative > 3.5 And Me.cboInitiative < 4.6 Then
Me.txtInitiative = "4 - Meets SP Expectations"
Else
If Me.cboInitiative > 4.5 And Me.cboInitiative < 5.6 Then
Me.txtInitiative = "5 - Meets SP Expectations"
Else
If Me.cboInitiative > 5.5 And Me.cboInitiative < 6.6 Then
Me.txtInitiative = "6 - Exceeds SP Expectations"
Else
If Me.cboInitiative > 6.5 And Me.cboInitiative < 7.6 Then
Me.txtInitiative = "7 - Exceeds SP Expectations"
End If
End If
End If
End If
End If
End If
End If
End If
If Me.cboDependability < 0.6 Then
Me.txtDependability = "0 - Not Observed"
Else
If Me.cboDependability > 0.5 And Me.cboDependability < 1.6 Then
Me.txtDependability = "1 - Does Not Meet SP Expectations"
Else
If Me.cboDependability > 1.5 And Me.cboDependability < 2.6 Then
Me.txtDependability = "2 - Does Not Meet SP Expectations"
Else
If Me.cboDependability > 2.5 And Me.cboDependability < 3.6 Then
Me.txtDependability = "3 - Meets SP Expectations"
Else
If Me.cboDependability > 3.5 And Me.cboDependability < 4.6 Then
Me.txtDependability = "4 - Meets SP Expectations"
Else
If Me.cboDependability > 4.5 And Me.cboDependability < 5.6 Then
Me.txtDependability = "5 - Meets SP Expectations"
Else
If Me.cboDependability > 5.5 And Me.cboDependability < 6.6 Then
Me.txtDependability = "6 - Exceeds SP Expectations"
Else
If Me.cboDependability > 6.5 And Me.cboDependability < 7.6 Then
Me.txtDependability = "7 - Exceeds SP Expectations"
End If
End If
End If
End If
End If
End If
End If
End If
If Me.cboCooperation < 0.6 Then
Me.txtCooperation = "0 - Not Observed"
Else
If Me.cboCooperation > 0.5 And Me.cboCooperation < 1.6 Then
Me.txtCooperation = "1 - Does Not Meet SP Expectations"
Else
If Me.cboCooperation > 1.5 And Me.cboCooperation < 2.6 Then
Me.txtCooperation = "2 - Does Not Meet SP Expectations"
Else
If Me.cboCooperation > 2.5 And Me.cboCooperation < 3.6 Then
Me.txtCooperation = "3 - Meets SP Expectations"
Else
If Me.cboCooperation > 3.5 And Me.cboCooperation < 4.6 Then
Me.txtCooperation = "4 - Meets SP Expectations"
Else
If Me.cboCooperation > 4.5 And Me.cboCooperation < 5.6 Then
Me.txtCooperation = "5 - Meets SP Expectations"
Else
If Me.cboCooperation > 5.5 And Me.cboCooperation < 6.6 Then
Me.txtCooperation = "6 - Exceeds SP Expectations"
Else
If Me.cboCooperation > 6.5 And Me.cboCooperation < 7.6 Then
Me.txtCooperation = "7 - Exceeds SP Expectations"
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
Many thanks in advance!
LDMueller
it the most simpliest way. Can anyone help me simplify this code.
Private Sub cmdtest_Click()
If Me.cboQualityWorkProduct < 0.6 Then
Me.txtQualityWorkProduct = "0 - Not Observed"
Else
If Me.cboQualityWorkProduct > 0.5 And Me.cboQualityWorkProduct < 1.6 Then
Me.txtQualityWorkProduct = "1 - Does Not Meet SP Expectations"
Else
If Me.cboQualityWorkProduct > 1.5 And Me.cboQualityWorkProduct < 2.6 Then
Me.txtQualityWorkProduct = "2 - Does Not Meet SP Expectations"
Else
If Me.cboQualityWorkProduct > 2.5 And Me.cboQualityWorkProduct < 3.6 Then
Me.txtQualityWorkProduct = "3 - Meets SP Expectations"
Else
If Me.cboQualityWorkProduct > 3.5 And Me.cboQualityWorkProduct < 4.6 Then
Me.txtQualityWorkProduct = "4 - Meets SP Expectations"
Else
If Me.cboQualityWorkProduct > 4.5 And Me.cboQualityWorkProduct < 5.6 Then
Me.txtQualityWorkProduct = "5 - Meets SP Expectations"
Else
If Me.cboQualityWorkProduct > 5.5 And Me.cboQualityWorkProduct < 6.6 Then
Me.txtQualityWorkProduct = "6 - Exceeds SP Expectations"
Else
If Me.cboQualityWorkProduct > 6.5 And Me.cboQualityWorkProduct < 7.6 Then
Me.txtQualityWorkProduct = "7 - Exceeds SP Expectations"
End If
End If
End If
End If
End If
End If
End If
End If
If Me.cboProductivity < 0.6 Then
Me.txtProductivity = "0 - Not Observed"
Else
If Me.cboProductivity > 0.5 And Me.cboProductivity < 1.6 Then
Me.txtProductivity = "1 - Does Not Meet SP Expectations"
Else
If Me.cboProductivity > 1.5 And Me.cboProductivity < 2.6 Then
Me.txtProductivity = "2 - Does Not Meet SP Expectations"
Else
If Me.cboProductivity > 2.5 And Me.cboProductivity < 3.6 Then
Me.txtProductivity = "3 - Meets SP Expectations"
Else
If Me.cboProductivity > 3.5 And Me.cboProductivity < 4.6 Then
Me.txtProductivity = "4 - Meets SP Expectations"
Else
If Me.cboProductivity > 4.5 And Me.cboProductivity < 5.6 Then
Me.txtProductivity = "5 - Meets SP Expectations"
Else
If Me.cboProductivity > 5.5 And Me.cboProductivity < 6.6 Then
Me.txtProductivity = "6 - Exceeds SP Expectations"
Else
If Me.cboProductivity > 6.5 And Me.cboProductivity < 7.6 Then
Me.txtProductivity = "7 - Exceeds SP Expectations"
End If
End If
End If
End If
End If
End If
End If
End If
If Me.cboEfficiency < 0.6 Then
Me.txtEfficiency = "0 - Not Observed"
Else
If Me.cboEfficiency > 0.5 And Me.cboEfficiency < 1.6 Then
Me.txtEfficiency = "1 - Does Not Meet SP Expectations"
Else
If Me.cboEfficiency > 1.5 And Me.cboEfficiency < 2.6 Then
Me.txtEfficiency = "2 - Does Not Meet SP Expectations"
Else
If Me.cboEfficiency > 2.5 And Me.cboEfficiency < 3.6 Then
Me.txtEfficiency = "3 - Meets SP Expectations"
Else
If Me.cboEfficiency > 3.5 And Me.cboEfficiency < 4.6 Then
Me.txtEfficiency = "4 - Meets SP Expectations"
Else
If Me.cboEfficiency > 4.5 And Me.cboEfficiency < 5.6 Then
Me.txtEfficiency = "5 - Meets SP Expectations"
Else
If Me.cboEfficiency > 5.5 And Me.cboEfficiency < 6.6 Then
Me.txtEfficiency = "6 - Exceeds SP Expectations"
Else
If Me.cboEfficiency > 6.5 And Me.cboEfficiency < 7.6 Then
Me.txtEfficiency = "7 - Exceeds SP Expectations"
End If
End If
End If
End If
End If
End If
End If
End If
If Me.cboInitiative < 0.6 Then
Me.txtInitiative = "0 - Not Observed"
Else
If Me.cboInitiative > 0.5 And Me.cboInitiative < 1.6 Then
Me.txtInitiative = "1 - Does Not Meet SP Expectations"
Else
If Me.cboInitiative > 1.5 And Me.cboInitiative < 2.6 Then
Me.txtInitiative = "2 - Does Not Meet SP Expectations"
Else
If Me.cboInitiative > 2.5 And Me.cboInitiative < 3.6 Then
Me.txtInitiative = "3 - Meets SP Expectations"
Else
If Me.cboInitiative > 3.5 And Me.cboInitiative < 4.6 Then
Me.txtInitiative = "4 - Meets SP Expectations"
Else
If Me.cboInitiative > 4.5 And Me.cboInitiative < 5.6 Then
Me.txtInitiative = "5 - Meets SP Expectations"
Else
If Me.cboInitiative > 5.5 And Me.cboInitiative < 6.6 Then
Me.txtInitiative = "6 - Exceeds SP Expectations"
Else
If Me.cboInitiative > 6.5 And Me.cboInitiative < 7.6 Then
Me.txtInitiative = "7 - Exceeds SP Expectations"
End If
End If
End If
End If
End If
End If
End If
End If
If Me.cboDependability < 0.6 Then
Me.txtDependability = "0 - Not Observed"
Else
If Me.cboDependability > 0.5 And Me.cboDependability < 1.6 Then
Me.txtDependability = "1 - Does Not Meet SP Expectations"
Else
If Me.cboDependability > 1.5 And Me.cboDependability < 2.6 Then
Me.txtDependability = "2 - Does Not Meet SP Expectations"
Else
If Me.cboDependability > 2.5 And Me.cboDependability < 3.6 Then
Me.txtDependability = "3 - Meets SP Expectations"
Else
If Me.cboDependability > 3.5 And Me.cboDependability < 4.6 Then
Me.txtDependability = "4 - Meets SP Expectations"
Else
If Me.cboDependability > 4.5 And Me.cboDependability < 5.6 Then
Me.txtDependability = "5 - Meets SP Expectations"
Else
If Me.cboDependability > 5.5 And Me.cboDependability < 6.6 Then
Me.txtDependability = "6 - Exceeds SP Expectations"
Else
If Me.cboDependability > 6.5 And Me.cboDependability < 7.6 Then
Me.txtDependability = "7 - Exceeds SP Expectations"
End If
End If
End If
End If
End If
End If
End If
End If
If Me.cboCooperation < 0.6 Then
Me.txtCooperation = "0 - Not Observed"
Else
If Me.cboCooperation > 0.5 And Me.cboCooperation < 1.6 Then
Me.txtCooperation = "1 - Does Not Meet SP Expectations"
Else
If Me.cboCooperation > 1.5 And Me.cboCooperation < 2.6 Then
Me.txtCooperation = "2 - Does Not Meet SP Expectations"
Else
If Me.cboCooperation > 2.5 And Me.cboCooperation < 3.6 Then
Me.txtCooperation = "3 - Meets SP Expectations"
Else
If Me.cboCooperation > 3.5 And Me.cboCooperation < 4.6 Then
Me.txtCooperation = "4 - Meets SP Expectations"
Else
If Me.cboCooperation > 4.5 And Me.cboCooperation < 5.6 Then
Me.txtCooperation = "5 - Meets SP Expectations"
Else
If Me.cboCooperation > 5.5 And Me.cboCooperation < 6.6 Then
Me.txtCooperation = "6 - Exceeds SP Expectations"
Else
If Me.cboCooperation > 6.5 And Me.cboCooperation < 7.6 Then
Me.txtCooperation = "7 - Exceeds SP Expectations"
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
Many thanks in advance!
LDMueller