I can't seem to find an answer for this anywhere. I'm sure it must be simple.
I have a query called say "Query1". It consists of the following:
------------------------------
PARAMETERS [enter surname] Text;
SELECT tblPERSON.SURNAME
FROM tblPERSON
WHERE tblPERSON.SURNAME=[enter surname];
------------------------------
I want to be able to call "Query1" via vba code.
i.e. "docmd.openquery QUERY1 etc". I also want to be able to automatically pass the value "Smith" into the parameter [enter surname]. Can anybody help please!
p.s. I don't want to hard code frmname.control into the query.
Thanks.
I have a query called say "Query1". It consists of the following:
------------------------------
PARAMETERS [enter surname] Text;
SELECT tblPERSON.SURNAME
FROM tblPERSON
WHERE tblPERSON.SURNAME=[enter surname];
------------------------------
I want to be able to call "Query1" via vba code.
i.e. "docmd.openquery QUERY1 etc". I also want to be able to automatically pass the value "Smith" into the parameter [enter surname]. Can anybody help please!
p.s. I don't want to hard code frmname.control into the query.
Thanks.