list box to return logical criteria

B

bicyclops

I've succesfully used list boxes to return criteria to my query where the
choices returned are either 1 or *.

But now I need to specify criteria from a list box that returns either 3 or
Not 3 (or <>3). Obviously this criteria works fine when specified directly in
the query. But when it is returned via the list box, the numerical value
works (3) but the logical value of either <>3 or Not 3 gives me nothing. It
seems like the query is treating it as literal text rather than a logical
operator.

Specifying Like or = doesn't seem to make any difference.
 
A

Andy Hull

Hi

Assuming you are looking for SQL like...

SELECT <fields>
FROM <tables and joins>
WHERE myfield = 3

{or WHERE myfield <> 3}

Make the list box entries = 3 and <> 3
(ie include the equals sign - I believe you already are including the not
equals sign)

and use SQL like...

SELECT <fields>
FROM <tables and joins>
WHERE eval(myfield & Forms!MyForm!ListBox)

hth

Andy Hull
 

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