There are many posts on the site about adding a criteria to the query to take the parameter from a control on a form. The downside to this is that the query only works when the form is open. The proper bagn dot notation for a control on a form is:
[Forms]![frmMain].[txtBox]
To make the query reusable, you can pass the parameter as a WHERE clause on the DoCmd.OpenReport line. This method allows you to check for valid data in the control before passing the parameter, and allows you to re-use the query for other processes.
HTH
mmcdonal
Look it up at:
http://wrox.books24x7.com