|
-
Feb 15th, 2001, 10:15 AM
#1
Thread Starter
Addicted Member
Hi
I have this formula that is suppose to look at two fields and determine if both are under the value, if the values are under the other value then it should write MFG DEFECT in the txtfields(8).
If Val(txtFields(5).Text) < 7.2 And Val(txtFields(7).Text) < Val(txtFields(4).Text) Then
txtFields(8) = "MFG DEFECT"
End If
It does not do that though, actually it doesn't do anything. I was wondering if someone could help me out with this?
Thanks
jeffro
-
Feb 15th, 2001, 10:19 AM
#2
Add another set of parenthesis'
Code:
If Val(txtFields(5).Text) < 7.2 And (Val(txtFields(7).Text) < Val(txtFields(4).Text)) Then
txtFields(8) = "MFG DEFECT"
End If
-
Feb 15th, 2001, 10:25 AM
#3
Thread Starter
Addicted Member
No that didn't help either, nice try though!
jeffro
-
Feb 15th, 2001, 11:15 AM
#4
Hyperactive Member
Ok, add the following line, and if the problem doesn't become obvious, post the results of the immediate window back here and I'll take a look.
Code:
Debug.Print "If " & Val(txtFields(5).Text) & " < 7.2 And " & Val(txtFields(7).Text) & " < " & Val(txtFields(4).Text) & " Then"
If Val(txtFields(5).Text) < 7.2 And Val(txtFields(7).Text) < Val(txtFields(4).Text) Then
txtFields(8) = "MFG DEFECT"
End If
-
Feb 15th, 2001, 11:27 AM
#5
Thread Starter
Addicted Member
jmcswain,
I have all this in the lost focus event:
If Val(txtFields(5).Text) < 7.2 Then
txtFields(8).Text = "CCA"
Else
If Val(txtFields(7).Text) < Val(txtFields(4).Text) Then
txtFields(8) = "RCT"
Else
If Val(txtFields(5).Text) < 7.2 And (Val(txtFields(7).Text) < Val(txtFields(4).Text)) Then
txtFields(8) = "MFG DEFECT"
End If
End If
End If
If Val(txtFields(5).Text) > 7.2 Then
txtFields(8).Text = ""
Else
If Val(txtFields(7).Text) > Val(txtFields(4).Text) Then
txtFields(8) = ""
End If
End If
My code seem to be working fine and now it is not work correctly at all. I'm having problems with getting the right (CCA, RCT, MFGDEFECT) to show up. Can you help me out, please?
thanks alot jeffro
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|