How do I write this select case
Text1 = 50
ThisValue = val(Text1)
Highvalue = 500
MedValue = 100
Select case ThisValue
case is > MedValue and < HighValue
msgbox "medValue"
case is >= Highvalue
msgbox "HighValue"
case else
do nothing
end select
How do I write this select case
Text1 = 50
ThisValue = val(Text1)
Highvalue = 500
MedValue = 100
Select case ThisValue
case is > MedValue and < HighValue
msgbox "medValue"
case is >= Highvalue
msgbox "HighValue"
case else
do nothing
end select
Waiting for a full featured smart phone with out marrying a provider
Go Android![]()
Go raiders
Just think about the conditions, and re-order it:
Code:Select Case ThisValue Case >= Highvalue msgbox "HighValue" Case > MedValue msgbox "medValue" case else end select
(2007, 2008, 2009, 2010, 2011, 2012) . . . . . . . . Hitchhiker's Guide to Getting Help at VBForums
Classic VB FAQs (updated Oct 2010) ...Database Development FAQs/Tutorials (updated May 2011)
(includes fixing common VB errors) .......... (includes fixing common DB related errors, and [Classic VB] ADO tutorial /further steps, and [VB.Net] ADO.Net Tutorial).
Tutorial: How to automate Excel from VB6 (or VB5/VBA) .. SQL 'Select' statement formatter/checker .. Convert colour number to colour name .. FlexGrid: fill from recordset .. FlexGrid: AutoSize columns .. DB Reserved Words checker
Connection strings .. MDAC/Jet/ACE downloads .. SQL Server downloads .. MZTools (free upgrade for the VB6/VBA Editor)
Thanks
Didn't know it selected the first true value and not look at the others
Waiting for a full featured smart phone with out marrying a provider
Go Android![]()
Go raiders
yes, if first true value . it will not go at second case statement . hope it might be help.Didn't know it selected the first true value and not look at the othersCode:Select Case ThisValue Case >= Highvalue 'when it is true msgbox "HighValue" 'it will come here Case > MedValue msgbox "medValue" case else end select 'and finally it will come here .