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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using "In" Statement in code

Status
Not open for further replies.

aggieval

Programmer
May 23, 2002
25
US
I am sure there is a simple answer, but I can't find it. Is it possible to use an "in" statement in code? I don't want to use multiple "or"s, but "in" doesn't work. Any help?

Thanks
 
why not a like "*hi*" i know in certain places i use this and it works like you want an in statement... there are limitations, but i don't use it much...

--James JHauge@jmjpc.net
Life is change. To deny change is to deny life.
 
I have used the In keyword many times in Access:

For text:
SELECT * FROM land WHERE Parcel IN("1234", "1235", "1236", "1237")


For Number:
SELECT * FROM land WHERE Parcel IN(1234, 1235, 1236, 1237) Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
For a finite number of constants or variables use SELECT.
Select Case lngCode
Case 1, 2, 3, 5, 8, 13, 21, 34, 55 ' Fibonacci numbers
.....
Case else
....
End Select Generate Forms/Controls Resizing/Tabbing Class
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top