dave_the_bear
New member
- Local time
- Today, 04:47
- Joined
- Aug 22, 2012
- Messages
- 9
The user should:
Enter the Expected Quantity in one field.
Enter the Faults in the other field.
The Lot Size field calculates and displays: [Expected Quantity] - [Faults]
Based on the Lot Size the Sample and Fail fields should be filled as follows:
The Lot Size field is being calculated but Im getting this error instead of the Sample and Fail fields filling:
"Compile error:
Sub or Function not defined"
Thanks
Enter the Expected Quantity in one field.
Enter the Faults in the other field.
The Lot Size field calculates and displays: [Expected Quantity] - [Faults]
Based on the Lot Size the Sample and Fail fields should be filled as follows:
Code:
Function SampleCal(Lot As Integer)
Select Case Lot
Case 2 To 8
Sample = 2
Fail = 1
Case 9 To 15
Sample = 3
Fail = 1
Case 16 To 25
Sample = 5
Fail = 1
Case 26 To 50
Sample = 8
Fail = 1
Case 51 To 90
Sample = 13
Fail = 1
Case 91 To 150
Sample = 20
Fail = 1
Case 151 To 280
Sample = 32
Fail = 2
Case 281 To 500
Sample = 50
Fail = 2
Case 501 To 1200
Sample = 80
Fail = 3
Case 1201 To 3200
Sample = 125
Fail = 4
Case Else
Sample = ""
Fail = ""
End Select
End Function
The Lot Size field is being calculated but Im getting this error instead of the Sample and Fail fields filling:
"Compile error:
Sub or Function not defined"
Thanks