J
Jimbo
I'm trying to use a parameter query, but assign the values using VBA rather
than prompting the user.
I've tried assigning values to the parameter at run time using code such as:
CurrentDb.QueryDefs("qryMyQuery").Parameters("MyParameter").value = MyValue
I assign this query to a subform:
[sfmMySubform].SourceObject = "Query.qryMyQuery"
but it ignores the parameter values, and prompts the user for the parameters
anyway.
Another strange quirk about the subform right afer the SourceObject is
assigned -- it prompts for the parameter twice, not just once. It's running
the query twice? Hmmm.
The SQL statement of the query looks like:
SELECT MyField
FROM tblMyTable
WHERE (((MyField2)=[MyParameter]));
So, how do I stop the parameter prompts this way? If I go total SQL, I could
probably do it, but I thought there would be a better way.
... Jim..
than prompting the user.
I've tried assigning values to the parameter at run time using code such as:
CurrentDb.QueryDefs("qryMyQuery").Parameters("MyParameter").value = MyValue
I assign this query to a subform:
[sfmMySubform].SourceObject = "Query.qryMyQuery"
but it ignores the parameter values, and prompts the user for the parameters
anyway.
Another strange quirk about the subform right afer the SourceObject is
assigned -- it prompts for the parameter twice, not just once. It's running
the query twice? Hmmm.
The SQL statement of the query looks like:
SELECT MyField
FROM tblMyTable
WHERE (((MyField2)=[MyParameter]));
So, how do I stop the parameter prompts this way? If I go total SQL, I could
probably do it, but I thought there would be a better way.
... Jim..