Don't replicate forms/reports for similar end uses; it's not good design practice. If you want this prompt every time the button is clicked, the simplest solution is to make the work order field a parameter field in the query for the report by surrounding a prompt in square brackets. You place this in the criteria field; e.g. [Work Order Number]. Some people don't advocate the use parameters in queries for whatever reason; I think it's just personal preference. The lack of a value after being prompted may result in unsatisfactory results, but it's quite a simple operation to copy your existing query, parametize it and see how it performs either way. You can also filter the report using the DoCmd.OpenReport filter parameter if you have a form control that contains the work order number.
Alternatively, you can provide a form textbox or combo for the value input and test if it's null or not. You'd have to execute one way if it's null and another if it's not. Depending on your preference, in vba you can
- build a valid sql statement without the WHERE part, and concatenate the WHERE part based on the existence of a value
- or run either of 2 queries (but then you're duplicating objects unnecessarily)
- or create a query definition on the fly but not store it in the Nav pane (probably more complicated than what you need)
- or create DAO parameters - definitely more complicated than what you need.
The point of the above being that as with most situations, there's more than one approach.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.