I have an Access 2002 project in which I have a form (with a sub-form) and I am having problems with the DoCmd.PrintOut code I'm trying to execute when the user clicks a command button with a printer icon on it. Before clicking the printer icon, they have 2 date controls which they fill in and click Apply to return data and display it in the sub-form. That works great. However, when they click on the printer icon which executes the following code:
If MsgBox("Do you want to print this form?", vbYesNo + vbQuestion) = vbYes Then
On Error GoTo 0
When the report prints out - the form, text boxes and outline of the sub-form print fine. But all of the boxes in the sub-form printout with #Name? or #Error in them. Any ideas why or how I can get around this without creating a report object?