Ok what an exciting adventure
A report is called from frmFacultyBudgetReport. This form has parms that are passed to the report.
Whe the form is called from the main menum, it all works great because I can print from the toolbar Print icon (the desired outcome).
- The event procedure for form is
stDocName = "rptFacultyBudgetReport_A"
DoCmd.OpenReport stDocName, acPreview
- The modal and popup are both No
But when the report is called from an intermediate Data Entry screen, things go awry.
Here's the sequence
--Main Menu which calls
--frmX (cbo year selection) which calls
--Data Entry screen, which calls
--frmFacultyBudgetReport (as above) which calls
--rptFacultyBudgetReportA (as above)
The frmx Event Procedure:
--stDocName = "frmFacultyBudgetHeader"
--DoCmd.OpenForm stDocName, , , stLinkCriteria
The Data Entry Screen Printer Icon Event Procedure:
--stDocName = "frmFacultyBudgetReport"
--DoCmd.OpenForm stDocName, acNormal, , , , acDialog
--DoCmd.Close acForm, stDocName
(A) The frmFacultyBudgetReport Event Procedure is same as shown at the top:
--stDocName = "rptFacultyBudgetReport_A"
--DoCmd.OpenReport stDocName, acPreview
Here's what happens:
--The report is displayed but behind the frmFacultyBudgetReport
--The user cannot click on the report at all.
So taking the hint about closing frmFacultyBudgetReport above, I added the following right after the open in (A)
--stDocName = "frmFacultyBudgetReport"
(B) DoCmd.Close acForm, stDocName
The upshot:
- The form is closed
- The report is displayed
- The report is displayed hidden UNDER the data entry screen
- I click on the report
- I click on the toolbar printer icon
- The message Now Printing is displayed
- An error appears "The expression is typed incorrectly or is too complex to be evaluated"
Something I think is wrong with (B)
Anyone think they got it?
Paul