Two answers then
Code:
Private Sub GenerateWorkOrder_Click()
Dim sWhere As String
Dim iMyID As Long
iMyID = Me!frmWorkOrderSubform.Form![Work Order No]
sWhere = "[WorkOrderNo] = " & iMyID
DoCmd.OpenReport "rptWorkOrder", acViewPreview, , sWhere
End Sub
Note the change to reflect the name. One of the problems with using spaces in field names is you then have to accommodate them by using square brackets.
Secondly answer:
You can put the subforms control reference into your query as a criteria.
With your form open, open your query and under the Work Order No field in the criteria click the Expression Builder. Locate your form then subform in the list and the select the control.
Don't do both of these - the code will be more useful long term, the saved filtered query is simpler but less flexible.