Hi everybody,
I have a case statement in my project that is not working and I can't see the issue. Anybody can help me please?
Am I allowed to use Boolean expression in each case statement? What is the solution then?
Thank you for your time and fast respond
I have a case statement in my project that is not working and I can't see the issue. Anybody can help me please?
When I call my function, any number that is assigned to riskRate (for example 1700). goes through case statement function and always executes "Case Else" clause only. Using breakpoints I am able to see the progress as well as wrong execution with any given number. It passes all cases and no matter what it executes the last statement.Private Function myBar(riskRate)
Select Case (riskRate)
Case (0 < riskRate <= 216)
Me.Box34.Visible = True
Me.myArrow.Top = 4000
Case (216 < riskRate <= 432)
Me.Box33.Visible = True
Me.myArrow.Top = 3700
Case (432 < riskRate <= 684)
Me.Box32.Visible = True
Me.myArrow.Top = 3400
Case (684 < riskRate <= 864)
Me.Box31.Visible = True
Me.myArrow.Top = 3100
Case (864 < riskRate <= 1080)
Me.Box30.Visible = True
Me.myArrow.Top = 2900
Case (1080 < riskRate <= 1296)
Me.Box29.Visible = True
Me.myArrow.Top = 2600
Case (1296 < riskRate <= 1512)
Me.Box28.Visible = True
Me.myArrow.Top = 2300
Case (1512 < riskRate <= 1728)
Me.Box27.Visible = True
Me.myArrow.Top = 2000
Case (1728 < riskRate <= 1944)
Me.Box26.Visible = True
Me.myArrow.Top = 1700
Case Else
Me.Box25.Visible = True
Me.myArrow.Top = 1400
End Select
End Function
Am I allowed to use Boolean expression in each case statement? What is the solution then?
Thank you for your time and fast respond