Query Criteria from Table...

  • Thread starter Thread starter ellefsonm
  • Start date Start date
E

ellefsonm

Guest
I have a large table that has many queries. The queries are set up differently, but all have one of the criterias the same. Is there a way to make the criteria a field in another table so that I can just change the data in that table and have all of the queries change to that value? It would be a real time saver, but i haven't found a way to do it yet.
 
Yes, just set up the table with a field that has your criteria. It's easiest if you have only a single record in that table with the criteria value, but if you want to keep multiple records in there, you can. An easy way around that is to have a column that says "Use" and just put a -1 in it to signify "True".

Then in your query criteria, use an expression like this:
Dlookup("yourfield","yourtablename")
if your table only has one record and
Dlookup("yourfield","yourtablename","[use]=True")
if your table has multiple records.

I haven't done this in a while, but should theoretically work.
 
Works perfectly. Thank you, thank you, thank you!
 
I know this is an old post. But it's answered part of what I'm trying to do. If I have one record it works perfectly. But I can't get the -1 part working to allow more than one record to be set.

Any pointers would be much appreciated.
 

Users who are viewing this thread

Back
Top Bottom