IN or INStr help

G

Guest

Here's the scenario, Members (parent) have (child) Skills. Skills uses a
lookup table so it stores numbers, not strings. I want a parameterized query
where the user enters Skill numbers and gets a list of the members that have
those skils.

I used

Expr1: InStr("," & [Type Member Skill Numbers separated by commas,Blank=All]
& ",","," & [MemberSkill1] & ",") in the design view for a coulmn

from another query that works fine, but this time it's not giving the
results I want. In fact it returns all rows. I tried IN([MemberSkill1]) in
the design view, but also, not results I want.

Suggestions?

Thanks,

HB
 
K

Ken Snell [MVP]

Because the InStr function returns a number that tells you the character
position where the "looked for" text string is found. If the string isn't
found, InStr returns a value of 0.

--

Ken Snell
<MS ACCESS MVP>

HB said:
I got it. I forgot the >0 in the criteria field. Why does that make it
work?


HB said:
Here's the scenario, Members (parent) have (child) Skills. Skills uses a
lookup table so it stores numbers, not strings. I want a parameterized
query
where the user enters Skill numbers and gets a list of the members that
have
those skils.

I used

Expr1: InStr("," & [Type Member Skill Numbers separated by
commas,Blank=All]
& ",","," & [MemberSkill1] & ",") in the design view for a coulmn

from another query that works fine, but this time it's not giving the
results I want. In fact it returns all rows. I tried
IN([MemberSkill1]) in
the design view, but also, not results I want.

Suggestions?

Thanks,

HB
 

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