On exit of a field on my form I have the following code for calculating a percent yield. It assigns a variable (test)to 135, 105, or 260 into the calculation based on the part number that was inputed. The problem is that it always assigns the variable to 135. I have tried numerous variations of this code. My default value is set to nothing.
If Me!DevicePartNumberID = 83007 Or 83021 Or 83135 Or 80354 Or 83128 Or 84015 Or 83141 Then
Me!test = 135
Else
If Me!DevicePartNumberID = 83034 Or 83101 Or 83097 Or 84024 Then
Me!test = 105
Else
If Me!DevicePartNumberID = 83169 Or 83182 Then
Me!test = 260
End If
End If
End If
Me!TotalWaferPerDeviceYield.Value = Me!DeviceYield / (Me!StartingQuantity * Me!test) * 100
Me!PercentDeviceYieldPerWafer.Value = (Me!TotalWaferPerDeviceYield / Me!StartingQuantity) * 100
Ideas appreciated.
If Me!DevicePartNumberID = 83007 Or 83021 Or 83135 Or 80354 Or 83128 Or 84015 Or 83141 Then
Me!test = 135
Else
If Me!DevicePartNumberID = 83034 Or 83101 Or 83097 Or 84024 Then
Me!test = 105
Else
If Me!DevicePartNumberID = 83169 Or 83182 Then
Me!test = 260
End If
End If
End If
Me!TotalWaferPerDeviceYield.Value = Me!DeviceYield / (Me!StartingQuantity * Me!test) * 100
Me!PercentDeviceYieldPerWafer.Value = (Me!TotalWaferPerDeviceYield / Me!StartingQuantity) * 100
Ideas appreciated.