trouble with QBF and multiple choices

H

hbean

Hi all. I have a QBF form with six options for users to select to
filter on. I want them to be able to select as few or as many options
as they like, and leave the others blank, and still have the query
return the correct records. Originally, I had this working with six
lines of criteria statements in the underlying query; but when I went
in to modify the query it stopped working with the error message
"Query is too complex" and Access had translated my six lines into
about 30+ (I was using "or like" critera). I have spent the past two
days trying to find another way to do this.

I have tried: tempvars in VBA - this will work but only if I select
something for all six options.
Creating the where clause on the fly in VBA - I can't figure out how
to execute the query and specify only the where clause.
Creating the whole query in SQL in VBA - I was getting "syntax error
missing operator in query expression" and now I'm getting "A RunSQL
action requires an argument consisting of an SQL statement".

Any help would be greatly appreciated. Would be glad to post code
although I'm not sure it's correct.

Thanks.
 

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