'Print Report' command button on form

First paragraph - correct.

The control source is CoNumber.

So does this mean I should be using this rather than the name of the text box?
 
Yes. Try the code now with:

DoCmd.OpenReport stDocName, acViewNormal, , "CoNumber=" & Me.CoID
 
It works!

Thanks again.

Out of interest, why does it have to be CoNumber on the report (control source) but it's ok to refer to CoID on the form (text box name - the control source of frmMain!CoID is also CoNumber)?
 
I believe it is because you are actually sending the WHERE portion of a SQL statement and you have to refer to the actually fieldname.

Good luck!
 

Users who are viewing this thread

Back
Top Bottom