Report header looks good in print preview but doesn't print

bumblingidiot

New member
Local time
Today, 15:59
Joined
Dec 1, 2011
Messages
4
First let me say that I am really a novice at all of this. Most of what I know about Access I have learned by doing.

I currently have a few forms set up where the end user selects from a drop down box, that info is fed to the query and then into the report header. This was working fine in 2003 but we just upgraded to 2007 and now it is not.

Here is an example of what I currently have -
The end user chooses a status from the combo box then clicks the "run" button which has this code:
Private Sub cmdRunCorrespondencebyApprovalStatus_Click()​
DoCmd.OpenReport "rptCorrespondencebyApprovalStatus-AllProjects", acViewPreview​
Me.Undo​
DoCmd.Close acForm, "frmChooseApprovalStatus-ReferenceforReport"​
End Sub​
In the query I am simply using this criteria:
[Forms]![frmChooseApprovalStatus-ReferenceforReport]![cboApprovalStatus]​
In the Report I have a label:
=Forms![frmChooseApprovalStatus-ReferenceforReport]!cboApprovalStatus​
When it opens in Print Preview it is fine. If you actually print it or change the view to report view there is nothing there.

I know what is happening is the form is closing without that information being communicated to the final report, but I'm not sure how to fix it. Some of what I tried:
I moved the code to close the form to the close action of the report. Fixed the header issue but then me.undo didn't work and a new record was created every time a report was run.
I tried to unbound the form but wasn't having any luck being able to do that and still allow selection of the combo box items.
I put a me.undo into the "on close" of the form that didn't work.
Hopefully this makes sense and someone can point me in the direction of possibilities to fix this issue.

Thank you so much for your time.
 
My criteria forms are typically unbound, and often have combo boxes for selecting options. Are you sure the form's allow edits property was set to Yes?
 
Let's not forget the Display When property of the control. You've most likely set it to Print Only. That won't show in Report View.
 
It's because the form was closed after the report was opened in Preview mode. The OP even said that leaving the form open "Fixed the header issue".
 
I was only making a small contribution. :) This is what I was referring to.
When it opens in Print Preview it is fine. If you actually print it or change the view to report view there is nothing there.
But yes it's a matter of keeping the form open and moving the Close command to the appropriate event.
 
But that bit that you were referring to was caused by the form being closed, not the Display When property, as clearly proven by the OP changing that timing.
 
I suppose it does because the form will be closed before the view is switched. But won't that have actually shown #Name?
 
My criteria forms are typically unbound, and often have combo boxes for selecting options. Are you sure the form's allow edits property was set to Yes?

I don't have much experience using unbound forms, but I'm pretty sure I changed that. I could click on the combobox and see the list, but I couldn't select an option. I will go back and double check.

Thanks for the advice.
 
Also verify the Locked property of the combo is No.
 

Users who are viewing this thread

Back
Top Bottom