Bring back exact id'sand not using InStr()

G

Guest

I am using Expr1: InStr([Type Member Numbers separated by
commas,Blank=All],[MemberNumber]) to allow the user to bring back a list of
Members based upon ID. I got this either from MS Site directly or off of the
discusssion group.

But since it uses InStr i get other members as well. Is there any syntax to
allow the users to enter any number of IDs and get only those Members?

tia.
 
W

Wayne Morgan

InStr will return the starting position of one string within another.

Example:
InStr("String1", "ing") will return 4

I believe what you are after is an IN statement in the criteria.

In (1, 44, 76, 88)
or
In ("Abe", "Mary", "John")
 
G

Guest

Thanks for the reply. I actually posted this in the wrong forum. It meant to
go to Access Queries. And, the actual answer is this:

InStr("," & [Type Member Numbers separated by commas,Blank=All] & ",",","
&
[MemberNumber] & ",")


Wayne Morgan said:
InStr will return the starting position of one string within another.

Example:
InStr("String1", "ing") will return 4

I believe what you are after is an IN statement in the criteria.

In (1, 44, 76, 88)
or
In ("Abe", "Mary", "John")

--
Wayne Morgan
MS Access MVP


HB said:
I am using Expr1: InStr([Type Member Numbers separated by
commas,Blank=All],[MemberNumber]) to allow the user to bring back a list
of
Members based upon ID. I got this either from MS Site directly or off of
the
discusssion group.

But since it uses InStr i get other members as well. Is there any syntax
to
allow the users to enter any number of IDs and get only those Members?

tia.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top