jacobtdad
asked on
I need to set mutlipe criteria IF Statement
I need to set a multiple criteria statement. I have the code below that works for one set of criteria but I need to add other levels. I need to set the field "MR" if the value is greater than .95 and less than .98.. etc. I have two more levels needed
Private Sub FinancailAccuracy_AfterUpd ate()
If FinancailAccuracy <= 0.95 Then Financial_Quality_Rating = "NME"
Private Sub FinancailAccuracy_AfterUpd
If FinancailAccuracy <= 0.95 Then Financial_Quality_Rating = "NME"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
omgang. Case 1 value between .01 and .94 Then Financial_Quality_Rating = "NME"
Case 2 value between .95 and .9849 Then Financial_Quality_Rating = "MR"
Case 3 value beetween .985 and .9949 Then ....= "CS"
Case 4 value between .9950 and .9979 Then ....= "HS"
Case 5 Greater than .9979 Then = "AB"
Case 2 value between .95 and .9849 Then Financial_Quality_Rating = "MR"
Case 3 value beetween .985 and .9949 Then ....= "CS"
Case 4 value between .9950 and .9979 Then ....= "HS"
Case 5 Greater than .9979 Then = "AB"
ASKER
Perfect answer. Great response time....
Public Function CheckFinancialAccuracy()
On Error GoTo Err_CheckFinancialAccuracy
Select Case Me.FinancialAccuracy
Case 0.01 To 0.94
strResult = "NME"
Case 0.95 To 0.9849
strReult = "MR"
Case 0.985 To 0.9949
strResult = "CS"
Case 0.995 To 0.9979
strResult = "HS"
Case Is > 0.9979
strResult = "AB"
Case Else
strResult = "value passed is outside of range"
End Select
Me.Financial_Quality_Ratin g = strResult
Exit_CheckFinancialAccurac y:
Exit Function
Err_CheckFinancialAccuracy :
MsgBox Err.Number & " (" & Err.Description & ") in procedure CheckFinancialAccuracy of Module Module9"
Resume Exit_CheckFinancialAccurac y
End Function
OM Gang
On Error GoTo Err_CheckFinancialAccuracy
Select Case Me.FinancialAccuracy
Case 0.01 To 0.94
strResult = "NME"
Case 0.95 To 0.9849
strReult = "MR"
Case 0.985 To 0.9949
strResult = "CS"
Case 0.995 To 0.9979
strResult = "HS"
Case Is > 0.9979
strResult = "AB"
Case Else
strResult = "value passed is outside of range"
End Select
Me.Financial_Quality_Ratin
Exit_CheckFinancialAccurac
Exit Function
Err_CheckFinancialAccuracy
MsgBox Err.Number & " (" & Err.Description & ") in procedure CheckFinancialAccuracy of Module Module9"
Resume Exit_CheckFinancialAccurac
End Function
OM Gang
jacobtdad, I posted another sample while you were accepting my solution. Thank you very much.
OM Gang
OM Gang
Select Case FinancialAccuracy
Case 1
Case 2
Case 3
Case Else
End Select
OM Gang
Please provide the different cases you wish to test for and I'll provide a sample.