You can try this
Create an empty query, for this example will call it MyQuery
Create a button on the form to assign SQL to this Query that include a
filter from a field in the form.
Use the code to change the sql within this query, and
then run it.
Application.CurrentDb.QueryDefs("MyQuery").SQL = "Select * From TableName
Where FieldName = " & Me.[Field Name In the form]
Docmd.OpenQuery "MyQuery"
=======================================
Or create a query with reference to the fields in the form
Select TableName.* From TableName Where FieldName =
Forms![FormName]![FieldName]
And create a button on the form to run the query
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benefit from it.
Good luck
Cindy said:
I have a query and I'm wondering is there a way to build a form that runs the
query and you can change certain conditions on the query through the form?