Select Case Construct 
Author Message
 Select Case Construct

Anybody please help me to identify whether the select case construct
belowmentioned is already correct since it couldn't run properly and
always jumped to the end function.

Thankin you in advance for your help.

Option Compare Database
Option Explicit

Function Kriter(Hmin As Double, HJual As Double) As String
    Select Case (0.05 <= Hmin <= 0.14)
            Case (HJual <= 0.05)
                    KriteriaJual = "Jelek"
            Case (0.05 <= HJual <= 0.14)
                    KriteriaJual = "Cukup"
            Case (0.14 < HJual <= 0.24)
                    KriteriaJual = "Bagus"
            Case (0.24 < HJual <= 0.34)
                    KriteriaJual = "Bagus"
            Case (0.34 < HJual <= 0.44)
                    KriteriaJual = "Bagus"
            Case (0.44 < HJual <= 0.54)
                    KriteriaJual = "Bagus"
            Case (0.54 < HJual <= 0.64)
                    KriteriaJual = "Bagus"
            Case (0.64 < HJual <= 0.74)
                    KriteriaJual = "Bagus"
            Case (0.74 < HJual <= 0.84)
                    KriteriaJual = "Bagus"
            Case (0.84 < HJual)
                    KriteriaJual = "Bagus"
                    End Select
    Select Case (0.14 < Hmin <= 0.24)
            Case (HJual <= 0.05)
                    KriteriaJual = "Jelek"
            Case (0.05 <= HJual <= 0.14)
                    KriteriaJual = "Jelek"
            Case (0.14 < HJual <= 0.24)
                    KriteriaJual = "Cukup"
            Case (0.24 < HJual <= 0.34)
                    KriteriaJual = "Bagus"
            Case (0.34 < HJual <= 0.44)
                    KriteriaJual = "Bagus"
            Case (0.44 < HJual <= 0.54)
                    KriteriaJual = "Bagus"
            Case (0.54 < HJual <= 0.64)
                    KriteriaJual = "Bagus"
            Case (0.64 < HJual <= 0.74)
                    KriteriaJual = "Bagus"
            Case (0.74 < HJual <= 0.84)
                    KriteriaJual = "Bagus"
            Case (0.84 < HJual)
                    KriteriaJual = "Bagus"
                    End Select
    Select Case (0.24 < Hmin <= 0.34)
            Case (HJual <= 0.05)
                    KriteriaJual = "Jelek"
            Case (0.05 <= HJual <= 0.14)
                    KriteriaJual = "Jelek"
            Case (0.14 < HJual <= 0.24)
                    KriteriaJual = "Jelek"
            Case (0.24 < HJual <= 0.34)
                    KriteriaJual = "Cukup"
            Case (0.34 < HJual <= 0.44)
                    KriteriaJual = "Bagus"
            Case (0.44 < HJual <= 0.54)
                    KriteriaJual = "Bagus"
            Case (0.54 < HJual <= 0.64)
                    KriteriaJual = "Bagus"
            Case (0.64 < HJual <= 0.74)
                    KriteriaJual = "Bagus"
            Case (0.74 < HJual <= 0.84)
                    KriteriaJual = "Bagus"
            Case (0.84 < HJual)
                    KriteriaJual = "Bagus"
                    End Select
    Select Case (0.34 < Hmin <= 0.44)
            Case (HJual <= 0.05)
                    KriteriaJual = "Jelek"
            Case (0.05 <= HJual <= 0.14)
                    KriteriaJual = "Jelek"
            Case (0.14 < HJual <= 0.24)
                    KriteriaJual = "Jelek"
            Case (0.24 < HJual <= 0.34)
                    KriteriaJual = "Jelek"
            Case (0.34 < HJual <= 0.44)
                    KriteriaJual = "Cukup"
            Case (0.44 < HJual <= 0.54)
                    KriteriaJual = "Bagus"
            Case (0.54 < HJual <= 0.64)
                    KriteriaJual = "Bagus"
            Case (0.64 < HJual <= 0.74)
                    KriteriaJual = "Bagus"
            Case (0.74 < HJual <= 0.84)
                    KriteriaJual = "Bagus"
            Case (0.84 < HJual)
                    KriteriaJual = "Bagus"
                    End Select
    Select Case (0.44 < Hmin <= 0.54)
            Case (HJual <= 0.05)
                    KriteriaJual = "Jelek"
            Case (0.05 <= HJual <= 0.14)
                    KriteriaJual = "Jelek"
            Case (0.14 < HJual <= 0.24)
                    KriteriaJual = "Jelek"
            Case (0.24 < HJual <= 0.34)
                    KriteriaJual = "Jelek"
            Case (0.34 < HJual <= 0.44)
                    KriteriaJual = "Jelek"
            Case (0.44 < HJual <= 0.54)
                    KriteriaJual = "Cukup"
            Case (0.54 < HJual <= 0.64)
                    KriteriaJual = "Bagus"
            Case (0.64 < HJual <= 0.74)
                    KriteriaJual = "Bagus"
            Case (0.74 < HJual <= 0.84)
                    KriteriaJual = "Bagus"
            Case (0.84 < HJual)
                    KriteriaJual = "Bagus"
                    End Select
    Select Case (0.54 < Hmin <= 0.64)
            Case (HJual <= 0.05)
                    KriteriaJual = "Jelek"
            Case (0.05 <= HJual <= 0.14)
                    KriteriaJual = "Jelek"
            Case (0.14 < HJual <= 0.24)
                    KriteriaJual = "Jelek"
            Case (0.24 < HJual <= 0.34)
                    KriteriaJual = "Jelek"
            Case (0.34 < HJual <= 0.44)
                    KriteriaJual = "Jelek"
            Case (0.44 < HJual <= 0.54)
                    KriteriaJual = "Jelek"
            Case (0.54 < HJual <= 0.64)
                    KriteriaJual = "Cukup"
            Case (0.64 < HJual <= 0.74)
                    KriteriaJual = "Bagus"
            Case (0.74 < HJual <= 0.84)
                    KriteriaJual = "Bagus"
            Case (0.84 < HJual)
                    KriteriaJual = "Bagus"
                    End Select
    Select Case (0.64 < Hmin <= 0.74)
            Case (HJual <= 0.05)
                    KriteriaJual = "Jelek"
            Case (0.05 <= HJual <= 0.14)
                    KriteriaJual = "Jelek"
            Case (0.14 < HJual <= 0.24)
                    KriteriaJual = "Jelek"
            Case (0.24 < HJual <= 0.34)
                    KriteriaJual = "Jelek"
            Case (0.34 < HJual <= 0.44)
                    KriteriaJual = "Jelek"
            Case (0.44 < HJual <= 0.54)
                    KriteriaJual = "Jelek"
            Case (0.54 < HJual <= 0.64)
                    KriteriaJual = "Jelek"
            Case (0.64 < HJual <= 0.74)
                    KriteriaJual = "Cukup"
            Case (0.74 < HJual <= 0.84)
                    KriteriaJual = "Bagus"
            Case (0.84 < HJual)
                    KriteriaJual = "Bagus"
                    End Select
    Select Case 0.74 < Hmin
            Case (HJual <= 0.05)
                    KriteriaJual = "Jelek"
            Case (0.05 <= HJual <= 0.14)
                    KriteriaJual = "Jelek"
            Case (0.14 < HJual <= 0.24)
                    KriteriaJual = "Jelek"
            Case (0.24 < HJual <= 0.34)
                    KriteriaJual = "Jelek"
            Case (0.34 < HJual <= 0.44)
                    KriteriaJual = "Jelek"
            Case (0.44 < HJual <= 0.54)
                    KriteriaJual = "Jelek"
            Case (0.54 < HJual <= 0.64)
                    KriteriaJual = "Jelek"
            Case (0.64 < HJual <= 0.74)
                    KriteriaJual = "Jelek"
            Case (0.74 < HJual <= 0.84)
                    KriteriaJual = "Cukup"
            Case (0.84 < HJual)
                    KriteriaJual = "Bagus"
                    End Select
End Function



Sat, 03 Nov 2001 03:00:00 GMT  
 Select Case Construct
Please read the many replies you have already gotten the
last time you posted.

--

Michael

-------------------------------
random junk of dubious value is at:
http://www.trigeminal.com


Quote:
> Anybody please help me to identify whether the select case
construct
> belowmentioned is already correct since it couldn't run
properly and
> always jumped to the end function.

> Thankin you in advance for your help.

> Option Compare Database
> Option Explicit

> Function Kriter(Hmin As Double, HJual As Double) As String
>     Select Case (0.05 <= Hmin <= 0.14)
>             Case (HJual <= 0.05)
>                     KriteriaJual = "Jelek"
>             Case (0.05 <= HJual <= 0.14)
>                     KriteriaJual = "Cukup"
>             Case (0.14 < HJual <= 0.24)
>                     KriteriaJual = "Bagus"
>             Case (0.24 < HJual <= 0.34)
>                     KriteriaJual = "Bagus"
>             Case (0.34 < HJual <= 0.44)
>                     KriteriaJual = "Bagus"
>             Case (0.44 < HJual <= 0.54)
>                     KriteriaJual = "Bagus"
>             Case (0.54 < HJual <= 0.64)
>                     KriteriaJual = "Bagus"
>             Case (0.64 < HJual <= 0.74)
>                     KriteriaJual = "Bagus"
>             Case (0.74 < HJual <= 0.84)
>                     KriteriaJual = "Bagus"
>             Case (0.84 < HJual)
>                     KriteriaJual = "Bagus"
>                     End Select
>     Select Case (0.14 < Hmin <= 0.24)
>             Case (HJual <= 0.05)
>                     KriteriaJual = "Jelek"
>             Case (0.05 <= HJual <= 0.14)
>                     KriteriaJual = "Jelek"
>             Case (0.14 < HJual <= 0.24)
>                     KriteriaJual = "Cukup"
>             Case (0.24 < HJual <= 0.34)
>                     KriteriaJual = "Bagus"
>             Case (0.34 < HJual <= 0.44)
>                     KriteriaJual = "Bagus"
>             Case (0.44 < HJual <= 0.54)
>                     KriteriaJual = "Bagus"
>             Case (0.54 < HJual <= 0.64)
>                     KriteriaJual = "Bagus"
>             Case (0.64 < HJual <= 0.74)
>                     KriteriaJual = "Bagus"
>             Case (0.74 < HJual <= 0.84)
>                     KriteriaJual = "Bagus"
>             Case (0.84 < HJual)
>                     KriteriaJual = "Bagus"
>                     End Select
>     Select Case (0.24 < Hmin <= 0.34)
>             Case (HJual <= 0.05)
>                     KriteriaJual = "Jelek"
>             Case (0.05 <= HJual <= 0.14)
>                     KriteriaJual = "Jelek"
>             Case (0.14 < HJual <= 0.24)
>                     KriteriaJual = "Jelek"
>             Case (0.24 < HJual <= 0.34)
>                     KriteriaJual = "Cukup"
>             Case (0.34 < HJual <= 0.44)
>                     KriteriaJual = "Bagus"
>             Case (0.44 < HJual <= 0.54)
>                     KriteriaJual = "Bagus"
>             Case (0.54 < HJual <= 0.64)
>                     KriteriaJual = "Bagus"
>             Case (0.64 < HJual <= 0.74)
>                     KriteriaJual = "Bagus"
>             Case (0.74 < HJual <= 0.84)
>                     KriteriaJual = "Bagus"
>             Case (0.84 < HJual)
>                     KriteriaJual = "Bagus"
>                     End Select
>     Select Case (0.34 < Hmin <= 0.44)
>             Case (HJual <= 0.05)
>                     KriteriaJual = "Jelek"
>             Case (0.05 <= HJual <= 0.14)
>                     KriteriaJual = "Jelek"
>             Case (0.14 < HJual <= 0.24)
>                     KriteriaJual = "Jelek"
>             Case (0.24 < HJual <= 0.34)
>                     KriteriaJual = "Jelek"
>             Case (0.34 < HJual <= 0.44)
>                     KriteriaJual = "Cukup"
>             Case (0.44 < HJual <= 0.54)
>                     KriteriaJual = "Bagus"
>             Case (0.54 < HJual <= 0.64)
>                     KriteriaJual = "Bagus"
>             Case (0.64 < HJual <= 0.74)
>                     KriteriaJual = "Bagus"
>             Case (0.74 < HJual <= 0.84)
>                     KriteriaJual = "Bagus"
>             Case (0.84 < HJual)
>                     KriteriaJual = "Bagus"
>                     End Select
>     Select Case (0.44 < Hmin <= 0.54)
>             Case (HJual <= 0.05)
>                     KriteriaJual = "Jelek"
>             Case (0.05 <= HJual <= 0.14)
>                     KriteriaJual = "Jelek"
>             Case (0.14 < HJual <= 0.24)
>                     KriteriaJual = "Jelek"
>             Case (0.24 < HJual <= 0.34)
>                     KriteriaJual = "Jelek"
>             Case (0.34 < HJual <= 0.44)
>                     KriteriaJual = "Jelek"
>             Case (0.44 < HJual <= 0.54)
>                     KriteriaJual = "Cukup"
>             Case (0.54 < HJual <= 0.64)
>                     KriteriaJual = "Bagus"
>             Case (0.64 < HJual <= 0.74)
>                     KriteriaJual = "Bagus"
>             Case (0.74 < HJual <= 0.84)
>                     KriteriaJual = "Bagus"
>             Case (0.84 < HJual)
>                     KriteriaJual = "Bagus"
>                     End Select
>     Select Case (0.54 < Hmin <= 0.64)
>             Case (HJual <= 0.05)
>                     KriteriaJual = "Jelek"
>             Case (0.05 <= HJual <= 0.14)
>                     KriteriaJual = "Jelek"
>             Case (0.14 < HJual <= 0.24)
>                     KriteriaJual = "Jelek"
>             Case (0.24 < HJual <= 0.34)
>                     KriteriaJual = "Jelek"
>             Case (0.34 < HJual <= 0.44)
>                     KriteriaJual = "Jelek"
>             Case (0.44 < HJual <= 0.54)
>                     KriteriaJual = "Jelek"
>             Case (0.54 < HJual <= 0.64)
>                     KriteriaJual = "Cukup"
>             Case (0.64 < HJual <= 0.74)
>                     KriteriaJual = "Bagus"
>             Case (0.74 < HJual <= 0.84)
>                     KriteriaJual = "Bagus"
>             Case (0.84 < HJual)
>                     KriteriaJual = "Bagus"
>                     End Select
>     Select Case (0.64 < Hmin <= 0.74)
>             Case (HJual <= 0.05)
>                     KriteriaJual = "Jelek"
>             Case (0.05 <= HJual <= 0.14)
>                     KriteriaJual = "Jelek"
>             Case (0.14 < HJual <= 0.24)
>                     KriteriaJual = "Jelek"
>             Case (0.24 < HJual <= 0.34)
>                     KriteriaJual = "Jelek"
>             Case (0.34 < HJual <= 0.44)
>                     KriteriaJual = "Jelek"
>             Case (0.44 < HJual <= 0.54)
>                     KriteriaJual = "Jelek"
>             Case (0.54 < HJual <= 0.64)
>                     KriteriaJual = "Jelek"
>             Case (0.64 < HJual <= 0.74)
>                     KriteriaJual = "Cukup"
>             Case (0.74 < HJual <= 0.84)
>                     KriteriaJual = "Bagus"
>             Case (0.84 < HJual)
>                     KriteriaJual = "Bagus"
>                     End Select
>     Select Case 0.74 < Hmin
>             Case (HJual <= 0.05)
>                     KriteriaJual = "Jelek"
>             Case (0.05 <= HJual <= 0.14)
>                     KriteriaJual = "Jelek"
>             Case (0.14 < HJual <= 0.24)
>                     KriteriaJual = "Jelek"
>             Case (0.24 < HJual <= 0.34)
>                     KriteriaJual = "Jelek"
>             Case (0.34 < HJual <= 0.44)
>                     KriteriaJual = "Jelek"
>             Case (0.44 < HJual <= 0.54)
>                     KriteriaJual = "Jelek"
>             Case (0.54 < HJual <= 0.64)
>                     KriteriaJual = "Jelek"
>             Case (0.64 < HJual <= 0.74)
>                     KriteriaJual = "Jelek"
>             Case (0.74 < HJual <= 0.84)
>                     KriteriaJual = "Cukup"
>             Case (0.84 < HJual)
>                     KriteriaJual = "Bagus"
>                     End Select
> End Function



Sat, 03 Nov 2001 03:00:00 GMT  
 Select Case Construct
Thanks Michael and I'm sorry I didn't read the replied from others
before.

What I wanna do is to make a logical grouping where:

When Hmin is Minimum Price to sell, Hjual is Sold Price and KriteriaJual
is Selling Criteria (to explain whether the selling price is "Bagus
(Good)", "Cukup (Average)" or "Jelek (Bad).

So example when Hmin is 0.05 <= Hmin <= 0.14 then it should be compared
to the Hjual conditions where it has some conditions also...so let say
if the Hjual is 0.34 < HJual <= 0.44 then KriteriaJual is "Bagus".

I hope it could give you some explainations and thanking you in advance
for your help.

Best regards
Ian



Sat, 03 Nov 2001 03:00:00 GMT  
 Select Case Construct
Why don't you look at the responses you already have first,
as your questions have been answered, I think. Instead of
thanking me in advance for helping you, you can thank the
people who have already tried to help you and not make them
feel like posted for nothing.

--

Michael

-------------------------------
random junk of dubious value is at:
http://www.trigeminal.com


Quote:
> Thanks Michael and I'm sorry I didn't read the replied
from others
> before.

> What I wanna do is to make a logical grouping where:

> When Hmin is Minimum Price to sell, Hjual is Sold Price
and KriteriaJual
> is Selling Criteria (to explain whether the selling price
is "Bagus
> (Good)", "Cukup (Average)" or "Jelek (Bad).

> So example when Hmin is 0.05 <= Hmin <= 0.14 then it
should be compared
> to the Hjual conditions where it has some conditions
also...so let say
> if the Hjual is 0.34 < HJual <= 0.44 then KriteriaJual is
"Bagus".

> I hope it could give you some explainations and thanking
you in advance
> for your help.

> Best regards
> Ian



Sat, 03 Nov 2001 03:00:00 GMT  
 Select Case Construct

On this occasion I would like to thank people who has helped me about the
select case statement:
Pieter Wijnen, Matthew Miller, Keri Hardwick and Michael Kaplan.

And I am sorry for not noticing the previous replied from all of you but at
the end your input has helped a lot to finish the program.

Thanks a lot and good luck....

B. Regards
Ian



Sat, 03 Nov 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Is it correct for select case construct??

2. VBScript Select Case vs VB Select Case

3. "select...case", multiples cases not possible ?

4. Select Case and Case 0 To 9

5. Dynamically constructed SELECT control is left-right squashed

6. Select Case module

7. Select case using NOT operator

8. Select case Zero

9. Help with Select Case...again

10. Select Case Statement Help

11. select case

12. Select case

 

 
Powered by phpBB® Forum Software