how to use a table to update search parameters in a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to use a form or table to change the search criteria in a
query linked to a different table. Ex of what I've found so far. in a
query using Like "*2004" I have multiple queries to change to 2004.
Someone suggested Like *[forms]![input year]![year] however it is not
working for me. Any suggestions would be appreciated. I would prefer to
use a table to input the data one time and the data be used in the multiple
queries.
 
Hi,
Without understanding your whole problem, I can help you with the syntax.

In Query Criteria area:
Like "*" & [User Input]
Everytime you execute the query, the pop up box will ask you to input "User
Input". If "2004" is entered, then you should get back all record that ends
"2004" in that field.

If Form was used:
Like "*" & forms![formname]![formfield]
It will produce the record ends "2004" in that field.

Hope this helps.
 
Mark:
use: DLookUp("[Field Name]","Table Name") as the criteria for as many
queries as you like. Then you can change what is in the table as you like
and all queries will run under the same criteria. What I like to do is set
up a macro with several queries--the first query is a make table query and
asks for user input, then I use the above syntax in all the rest of the
queries and point it to the newly-created make table. That way you can have
a bunch of queries run and only have to provide input once.

JL said:
Hi,
Without understanding your whole problem, I can help you with the syntax.

In Query Criteria area:
Like "*" & [User Input]
Everytime you execute the query, the pop up box will ask you to input "User
Input". If "2004" is entered, then you should get back all record that ends
"2004" in that field.

If Form was used:
Like "*" & forms![formname]![formfield]
It will produce the record ends "2004" in that field.

Hope this helps.


Mark said:
Is there a way to use a form or table to change the search criteria in a
query linked to a different table. Ex of what I've found so far. in a
query using Like "*2004" I have multiple queries to change to 2004.
Someone suggested Like *[forms]![input year]![year] however it is not
working for me. Any suggestions would be appreciated. I would prefer to
use a table to input the data one time and the data be used in the multiple
queries.
 
Back
Top