In query design, you can just put your parameter in the query.
To run it programmatically, you can then use RunSQL in a macro or code.
A better programmatic approach might be to build the SQL statement in code,
concatenating the parameter value into the string. Then Execute the string
itself: you don't need a saved query. The advantage is that you know whether
it worked or not. Here's an example:
Action queries: suppressing dialogs, while knowing results
at: http://allenbrowne.com/ser-60.html