Datasheet view of Parameter Query

  • Thread starter Thread starter Larry
  • Start date Start date
L

Larry

I need to write some code that will pass parameters to a query, based on
input from a form, then open that query in datasheet view.

I know how to set parameters using QueryDefs, then use that as a recordset.
But in this case, after I set the parameters, I want to open the query to
view the results.

I could probably do this with a form, but I really don't need the form. Just
the query results. Can this be done?
 
Why not do

DoCmd.OpenQuery "query1", acViewNormal

and in the query just set the parameters to reference the form ie

SELECT * FROM MyTable WHERE MyField = [forms]![form1]![text1]
 
Thank you for stating the obvious! I missed that option totally!

That's what I get for trying to make it harder than it needed to be.

JohnFol said:
Why not do

DoCmd.OpenQuery "query1", acViewNormal

and in the query just set the parameters to reference the form ie

SELECT * FROM MyTable WHERE MyField = [forms]![form1]![text1]




Larry said:
I need to write some code that will pass parameters to a query, based on
input from a form, then open that query in datasheet view.

I know how to set parameters using QueryDefs, then use that as a recordset.
But in this case, after I set the parameters, I want to open the query to
view the results.

I could probably do this with a form, but I really don't need the form. Just
the query results. Can this be done?
 
Back
Top