Ok, change it to:
Private Sub Command21_Click()
DoCmd.OpenReport "CODE Q & J CREDITS Subreport", acViewPreview,,"[CustNo]=" & Text25
End Sub
That's all you needed. And frankly, I would NOT embed the subreports on the form. Since you are already opening the report in Print Preview then you are just adding unnecessary steps and wasting your users time.
Just let them enter CustNo and open the report.
As Ken is pointing out you don't even need the search button. The only purpose of the search button is to confirm the CustNo exists. But there is a better way. Use a Combobox to select the Customer by name. the combo box would have the following relevant
properties:
Rowsource: "SELECT CustNo, Custname FROM tblCustomers ORDER BY Custname;
Bound column: 1
Column Count: 2
Column Widths: 0";2"
So then its impossible for them to select an invalid CustNo. In fact you can make this even shorter by using this code in the After Update event of the combo
DoCmd.OpenReport "CODE Q & J CREDITS Subreport", acViewPreview,,"[CustNo]=" & cboCustomer
By the way, its not good practice to use spaces or special characters in object names. this can come back to haunt you. I'm using cboCustomer as the name of the combox, you should select your actual controlname.
But don't accept the default names (like Text25). When you go back to look at your code you aren't going to rememberer what Text25 is.