I see. That makes a lot of sense now.
I think the easiest thing is to create two queries. The OR operator
actually means AND/OR. In other word, one OR the other OR both. That being
the case, it has to evaluate both forms. If one form isn't open, it can't
evaluate properly. There is a VERY slim chance that XOR would work.
That's the Exclusive OR which means one OR the other but NOT both. (Can't
take the time to test it just now, but I'd love to know if it works.)
However, I still think it will fail.
If it's a very complicated query or one that will have to be change often,
you might create the query in code. On my website
(
www.rogersaccesslibrary.com), there is a small sample database called
"CreateQueries2.mdb" which illustrates how.
But as I said, probably the easiest thing is to have two queries.
--
--Roger Carlson
Access Database Samples:
www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
Joel said:
Well I have a bunch of reports that need to be filtered by the area and unit.
(This is done by using a form that opens the report)
In the forms, the cbArea controls what shows up in the cbUnit via a query.
(So you can only select the units that are in a certain area)
In the Query that does this, it has the Area Table and Unit Table and the
criteria for the AreaID is the cbArea in a form.
As of now I have 2 different forms (for different Reports) that is filtered
by the users selections on the form.
I was wondering if I could use the same query for both of them, if I cant
that means I will have to make a new (but Identical, except for the criteria)
query for each form.
Hope that clarifys a bit.
Thanks
Roger Carlson said:
Not sure I understand. In order for a control on a form to have a value
that you can use in a query, the form has to be open. So in this case, both
forms must be open. Can you explain what you are trying to do a little
more?
--
--Roger Carlson
Access Database Samples:
www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
I have a few different forms that need the same fields from a single
query.
If I put in [Forms]![MyForm]![cbBox] OR [Forms]![My2ndForm]![cbBox] it
asks
for both of them if both forms aren't open.
How do I get it where different forms can use the same query with
different
criteria?
Thanks