Is it correct for select case construct?? 
Author Message
 Is it correct for select case construct??

No, this is not the way to do it. A select case compares the
first value to the other values.... so you need the first
value from the "SELECT CASE" to have a single value, perhaps
HMin? The values in the CASE statements must be a single
value or range.

It is hard to give more info than that because it is not
clear what the heck this function is supposed to do,
rreally, only clear that this function as it stands will do
nothing useful. Perhaps you could give some more detail on
what you are trying to do?

--

Michael

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


Quote:
> I really need help for this module...pls somebody help
me...thanks a lot

> 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  
 Is it correct for select case construct??

Hiya, you really need to use nested if's (with and's maybe didn't look
to closely)

if HJual <= 0.05 Then
   KriteriaJual = "Jelek"
ElseIf HJual <= 0.14 Then
   KriteriaJual = "Cukup"
ElseIf HJual <= 0.24 Then
   KriteriaJual = "Bagus"
   ....
End If      
--
Regards
Pieter Wijnen


http://www.thuleeng.com

Tough guys don't take backup - tough guys cry a lot..

Good site to look for Access answers is:
http://home.att.net/~dashish

  wijnen.vcf
< 1K Download


Sat, 03 Nov 2001 03:00:00 GMT  
 Is it correct for select case construct??
It *looks* like you need nested Select Case statements, though I'm not sure
of this.  Here's my best guess at what you need:

Select Case HMin
    Case 0.05 to 0.14
        Select Case HJual
            Case <= 0.05
                KriteriaJual = "Jelek"
            Case >0.05 and <= 0.14
                KriteriaJual = "Cukup"
            Case > 0.14
                KriteriaJual = "Bagus"
                    'you don't need all the separate cases if the result is
the same
        End Select
    Case >0.14 and <= 0.24
        Select Case HJual
            ....
        End Select
    ...
    End Select

For each possible range (Case) for HMin, you add an entire Select Case
structure for HJual.

Keri Hardwick

Quote:

>I really need help for this module...pls somebody help me...thanks a lot

>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  
 
 [ 3 post ] 

 Relevant Pages 

1. Select Case Construct

2. Select Case - What am I doing wrong?

3. VBScript Select Case vs VB Select Case

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

5. Select Case and Case 0 To 9

6. Dynamically constructed SELECT control is left-right squashed

7. Dynamic Bookmarks and Selecting the Correct Template

8. Correct SELECT Statement

9. ***** Where clause in recordset won't select the correct records *****

10. ListView not reporting correct selected item

11. Need help finding the correct select statment.

12. Correct SELECT Statement

 

 
Powered by phpBB® Forum Software