Click here to Skip to main content
16,005,467 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Creating an sql adapter,datatable and populating the fields of a grid Pin
Christian Graus18-Aug-05 14:49
protectorChristian Graus18-Aug-05 14:49 
QuestionGet list of machines in LAN? Pin
Jimmy Huynh17-Aug-05 16:46
Jimmy Huynh17-Aug-05 16:46 
AnswerRe: Get list of machines in LAN? Pin
Mohamad Al Husseiny17-Aug-05 16:50
Mohamad Al Husseiny17-Aug-05 16:50 
AnswerRe: Get list of machines in LAN? Pin
Steve Pullan17-Aug-05 17:26
Steve Pullan17-Aug-05 17:26 
AnswerRe: Get list of machines in LAN? Pin
Anonymous17-Aug-05 17:54
Anonymous17-Aug-05 17:54 
GeneralCalendar control in Access forms Pin
Anonymous17-Aug-05 12:43
Anonymous17-Aug-05 12:43 
GeneralRe: Calendar control in Access forms Pin
Anonymous17-Aug-05 12:44
Anonymous17-Aug-05 12:44 
GeneralUsing IS in Select Case Pin
dotnetCarpenter17-Aug-05 10:02
dotnetCarpenter17-Aug-05 10:02 
Hi all.

It might be the late hour but I can't figure out why this little piece of code won't work when I apply it in the real world:


' selectTest should eval to true...<br />
Sub doTest()<br />
selectTest 543<br />
End Sub<br />
<br />
Function selectTest(intAntal%)<br />
Select Case (intAntal)<br />
  Case ((30 / 20) * 100), Is >= 100<br />
    selectTest= True<br />
    Exit Function<br />
  Case Else<br />
    selectTest= False<br />
End Select<br />
End Function

While this work, the equaling real code won't:

With objStation.Parkeringer(intP).Taellinger(intT)<br />
  Select Case (.intAntalPladser)<br />
    Case 0<br />
      SkalMed = True<br />
      If .intAntalParkeret = 0 Then<br />
        MsgBox "På " & objStation.strNavn & " er der en tælling med" & _<br />
               " 0 P-pladser og 0 parkeret." & Chr(10) & _<br />
               "Stationen kommer med i rapporten.", vbInformation, "Advarsel"<br />
        End If<br />
      Exit Function<br />
    Case ((.intAntalParkeret / .intAntalPladser) * 100), Is >= intBelaegningsprocent<br />
      SkalMed = True<br />
      Exit Function<br />
    Case 1345, Is > 90 ' the code should at least stop here... but doesn't<br />
      Stop<br />
    Case Else<br />
      SkalMed = False<br />
  End Select<br />
End With



The above select case (almost) always returns false. It seems like it works sometimes. Like when intBelaegningsprocent is set to 5 but not 80 or 90.

Any ideas on why this happens?!?

Regards Jon.

Moving to C# .NET - the grass is always greener..
GeneralRe: Using IS in Select Case Pin
Steve Pullan17-Aug-05 15:00
Steve Pullan17-Aug-05 15:00 
GeneralRe: Using IS in Select Case Pin
dotnetCarpenter22-Aug-05 4:26
dotnetCarpenter22-Aug-05 4:26 
GeneralPrinting Array of Bytes to File Pin
ChemmieBro17-Aug-05 7:55
ChemmieBro17-Aug-05 7:55 
GeneralRe: Printing Array of Bytes to File Pin
BammBamm17-Aug-05 8:49
BammBamm17-Aug-05 8:49 
Generalftp Pin
17-Aug-05 7:54
suss17-Aug-05 7:54 
GeneralRe: ftp Pin
Mohamad Al Husseiny17-Aug-05 16:55
Mohamad Al Husseiny17-Aug-05 16:55 
GeneralVBA call to a vb.net dll Pin
FlyngTiger17-Aug-05 7:01
FlyngTiger17-Aug-05 7:01 
GeneralRe: VBA call to a vb.net dll Pin
Anonymous17-Aug-05 7:09
Anonymous17-Aug-05 7:09 
GeneralRe: VBA call to a vb.net dll Pin
FlyngTiger17-Aug-05 7:12
FlyngTiger17-Aug-05 7:12 
GeneralSimple Syntax Issue Pin
Capilano17-Aug-05 5:11
Capilano17-Aug-05 5:11 
GeneralRe: Simple Syntax Issue Pin
Dave Kreskowiak17-Aug-05 5:31
mveDave Kreskowiak17-Aug-05 5:31 
GeneralRe: Simple Syntax Issue Pin
Capilano17-Aug-05 6:46
Capilano17-Aug-05 6:46 
GeneralRe: Simple Syntax Issue Pin
Anonymous17-Aug-05 7:05
Anonymous17-Aug-05 7:05 
GeneralRe: Simple Syntax Issue Pin
Capilano17-Aug-05 7:10
Capilano17-Aug-05 7:10 
GeneralRe: Simple Syntax Issue Pin
Dave Kreskowiak18-Aug-05 4:35
mveDave Kreskowiak18-Aug-05 4:35 
GeneralRe: Simple Syntax Issue Pin
Anonymous18-Aug-05 5:09
Anonymous18-Aug-05 5:09 
GeneralInserting data using web form with less code Pin
User 191970217-Aug-05 4:27
User 191970217-Aug-05 4:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.