473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Is there an "IN" statement in VBA like the one in SQL Server?

Just like the title says.

I'm trying to do something like "Select * from table where somefield
in ('222', '333', '444')"

I'm pretty good at the Google but trying to search for the word "in"
is impossible. Anyone got an answer?

Jan 28 '07 #1
2 4772
"ManningFan" <ma********@gmail.comwrote in message
news:11*********************@s48g2000cws.googlegro ups.com...
Just like the title says.

I'm trying to do something like "Select * from table where somefield
in ('222', '333', '444')"

I'm pretty good at the Google but trying to search for the word "in"
is impossible. Anyone got an answer?
Yep. (why not try it and see what happens?)

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jan 28 '07 #2
"Rick Brandt" <ri*********@hotmail.comwrote in message
news:TU*******************@newssvr13.news.prodigy. net...
"ManningFan" <ma********@gmail.comwrote in message
news:11*********************@s48g2000cws.googlegro ups.com...
>Just like the title says.

I'm trying to do something like "Select * from table where somefield
in ('222', '333', '444')"

I'm pretty good at the Google but trying to search for the word "in"
is impossible. Anyone got an answer?

Yep. (why not try it and see what happens?)
Hold on now, I was responding to your message text and have just now noticed
your subject line. Do you want to do this in VBA or in a SELECT statement? It
will work in the latter, not the former. Unless you are constructing a SELECT
statement within a VBA routine in which case it will work fine.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jan 28 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Carroll | last post by:
Does anyone know what the limit is on the number of items you can include inside of the "IN" function? Thank you. Carroll Rinehart Baltimore
11
by: (Pete Cresswell) | last post by:
I'd like to avoid coding a long set of IF... OR IF...statements. I can do a Select Case, but that would only let me case out on a single value. What I'm looking for is something like If...
43
by: markryde | last post by:
Hello, I saw in some open source projects a use of "!!" in "C" code; for example: in some header file #define event_pending(v) \ (!!(v)->vcpu_info->evtchn_upcall_pending & \...
1
by: Electric Co. | last post by:
Hello, I have two questions: 1.) Could I create a custom server control in 2005 in order to leverage the CompositeControl base class and then use that control in 2003? (fingers crossed but...
4
by: Bart op de grote markt | last post by:
Hello I used to work in a Sybase database environment. When I had to insert/ update records in the database, I always used "insert on existing update", in this way, you didn't have to check...
3
by: ChildProgrammer | last post by:
I am trying to upload data into an Access db from vb.net. The data was parsed out from text files. Everything seems to be working fine up till the .execute point. The debugger insists there is a...
0
by: bharadwajrv | last post by:
I have created the sequence in the DB2 and i need to query what will be the next possible value for this sequence... Ex. Select NEXT VALUE for schema_name.sequence_name but above sql statement...
4
by: GLSmyth | last post by:
I need to select cells from one table that do not appear in a second table. I know that this can be done in some flavors of SQL by using Except: Select Unit_PK From Table1 Except Select Unit_PK...
4
by: Steven Kogan | last post by:
I was trying Google an answer for this question and couldn't find a good substitute for SQL's IN feature in VBA from the postings that came up. In VBA the closest I could get to a construct of: ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.