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_AfterUpdate()
If FinancailAccuracy <= 0.95 Then Financial_Quality_Rating = "NME"
jacobtdadAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

omgangIT ManagerCommented:
You can use a Select ...Case statement to accomplish this

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.
0
omgangIT ManagerCommented:
Quick example.
OM Gang



Public Function CheckFinancialAccuracy(dblFA As Double)

On Error GoTo Err_CheckFinancialAccuracy

    Dim FinancialAccuracy As Double
    Dim strMsg As String
   
    FinancialAccuracy = dblFA
   
    Select Case FinancialAccuracy
        Case Is <= 0.95
            strMsg = "0.95 or less"
        Case 0.9500001 To 0.9799999
            strMsg = "Between 0.95 and 0.98"
        Case Else
            strMsg = "outside of range"
    End Select
   
    MsgBox strMsg

Exit_CheckFinancialAccuracy:
    Exit Function

Err_CheckFinancialAccuracy:
    MsgBox Err.Number & " (" & Err.Description & ") in procedure CheckFinancialAccuracy of Module Module9"
    Resume Exit_CheckFinancialAccuracy

End Function
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jacobtdadAuthor Commented:
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"
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

jacobtdadAuthor Commented:
Perfect answer.  Great response time....
0
omgangIT ManagerCommented:
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_Rating = strResult

Exit_CheckFinancialAccuracy:
    Exit Function

Err_CheckFinancialAccuracy:
    MsgBox Err.Number & " (" & Err.Description & ") in procedure CheckFinancialAccuracy of Module Module9"
    Resume Exit_CheckFinancialAccuracy

End Function


OM Gang
0
omgangIT ManagerCommented:
jacobtdad, I posted another sample while you were accepting my solution.  Thank you very much.

OM Gang
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.