Queries with linked criteria

  • Thread starter Thread starter Tony
  • Start date Start date
T

Tony

I have a set of queries that I run on a 3 physician
office databases each month, each office has the same
queries, but thusfar I have had to go into each query and
change the crierion that specifies which office I am
extracting data for. Is there anyway I can have the
criteria area in the query refer to some button(like what
would be a named cell in excel) that could specify the
criterion and therefore change all the queries at once.
That way I could just change this button, instead of all
the queries.

Tony
 
Sure.
Use a Textbox on a form for your variable.

Then in your query criteria refer to it.
Forms![FormName]![txtName]

if you want all records back when txtName is blank (and you have no Nulls in
your field) then use this:
Like iif(isnull(Forms![FormName]![txtName],'*',Forms![FormName]![txtName])
 
Back
Top