I'm hoping someone has seen this problem before and can give me some idea on how to fix. Frustration doesn't describe ...
I have a pop-up parameter form that allows the user to select from six (6) drop down combo boxes to filter a report (NIFC Report). The form is tied to a parameter query for its records and the OK button on the form (Report Parameters) has the following code:
Private Sub cmdOK_Click()
On Error Go To cmdOK_Click_Err
DoCmd.OpenReport "NIFC Report", acViewReport
DoCmd.Close acForm,"Report Parameters"
cmdOK_Click_Exit
Exit Sub
cmdOK_Click_Err:
MsgBox Error$
Resume cmdOK_Click_Exit
End Sub
The form and query work perfectly and the report pops up with exactly the records I need. There is never a problem .. until I try to print the report. Whe I select print or print preview, an access-generated parameter form asks for all six of the parameters again (I already selected my parameters from the form to produce my report ... grrrrrr). Almost anything can happen from this point forward. I simly want to print the report that's on the screen, but (Access) wants to print every record in the database. I have to quickly cancel print to save a tree. Or, it will print in datasheet format, rather than the report format I see on screen. Or, it wants to print the last report I worked with from another Access database.
It's almost as if Access doesn't recognize the report and/or record set that's just been produced and is on the screen. Is there code that I've failed to include or have I set up my report incorrectly?