If the search form is named frmParam, and it has a text box named LastName,
set the criteria for the LastName field in the query to:
Forms!frmParam!LastName
The form needs to be opened before the query.
If you need further information, please provide greater detail. For
instance, what didn't work?