Not clear what your situation is. If there's a chance you can enter a
"wrong parameter" for a query, consider a different approach.
You could create a form (unbound), create a combo box (which lists only
correct values), and create a command button which runs the query. You'd
have to modify the query to use the value selected in the combobox as its
parameter, rather than an entered value.