SeadnaS
Programmer
- May 30, 2011
- 214
I've done something wrong here it seems. The following code is giving me all "FAIL" results even when it should be "PASS". I want my subform to display pass/fail results in the column next to the x1 number but this code is only showing fail. What could be causing this?
Private Sub x1_Change()
If Me.Parent.TESTS.Value = 1 Then
If x1 >= Me.Parent.SPEC1.Value Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
If Me.Parent.TESTS.Value = 2 Then
If x1 <= 20 Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
If Me.Parent.TESTS.Value = 3 Then
Me.passfail.Value = "N/A"
End If
If Me.Parent.TESTS.Value = 4 Then
If (x1 <= Me.Parent.bodmax And x1 >= Me.Parent.bodmin) Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
If Me.Parent.TESTS.Value = 5 Then
If (x1 <= Me.Parent.bodqmax And x1 >= Me.Parent.bodqmin) Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
If Me.Parent.TESTS.Value = 6 Then
If x1 >= 5 Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
If Me.Parent.TESTS.Value = 7 Then
If x1 >= 5 Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
If Me.Parent.TESTS.Value = 8 Then
If x1 >= 5 Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
If Me.Parent.TESTS.Value = 9 Then
If x1 >= 10 Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
If Me.Parent.TESTS.Value = 10 Then
If x1 = "Pass" Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
Private Sub x1_Change()
If Me.Parent.TESTS.Value = 1 Then
If x1 >= Me.Parent.SPEC1.Value Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
If Me.Parent.TESTS.Value = 2 Then
If x1 <= 20 Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
If Me.Parent.TESTS.Value = 3 Then
Me.passfail.Value = "N/A"
End If
If Me.Parent.TESTS.Value = 4 Then
If (x1 <= Me.Parent.bodmax And x1 >= Me.Parent.bodmin) Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
If Me.Parent.TESTS.Value = 5 Then
If (x1 <= Me.Parent.bodqmax And x1 >= Me.Parent.bodqmin) Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
If Me.Parent.TESTS.Value = 6 Then
If x1 >= 5 Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
If Me.Parent.TESTS.Value = 7 Then
If x1 >= 5 Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
If Me.Parent.TESTS.Value = 8 Then
If x1 >= 5 Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
If Me.Parent.TESTS.Value = 9 Then
If x1 >= 10 Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
If Me.Parent.TESTS.Value = 10 Then
If x1 = "Pass" Then
Me.passfail.Value = "PASS"
Else: Me.passfail.Value = "FAIL"
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Sub