I would like to have a DoCmd open a parameter query, but I do not know how to pass a single parameter to the query. Is this possible? If not, how does one automate the use of a parameter query?
I don't use the DoCmd statement but here's how I automate my parameter queries:
Dim dbClient As Database
Dim qdf As QueryDef
Set dbClient = CurrentDb
Set qdf = dbClient.QueryDefs("Query1")
qdf.Parameters![Year Month] = rs("YRMTH")
qdf.Execute
where [Year Month] is the paramater in my query and rs("YRMTH") is a variable that I have retreived from a recordset in the module. It could just as well be the name of a control on your form.