Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If Statement with Between 2

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
0
0
US
I may be having a brain fart but here goes..

Is it possible to create an IF statement like the following

IF txtCode Between "1000" AND "1999" Then

do something

else

do something

End If

I am basically trying to find a range of whats entered into a textbox..

Thanks

 
You could use

If (txtCode >= 1000 And txtCode<= 1999) Then
DoWhatever
Else
DoSomethingElse
End If
 
No between keyword but you can use the case statement.

Select Case txtcode
Case "1000" To "1999"
do something
Case else
do something else
End Select

&quot;Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.&quot;
 
I told you I had a brain fart...Sorry to even ask this question...Case to hu??? didn't even try that...both suggestions are good...

Thanks guys

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top