K
Kevin Bruce
An On_Click event is used to open a report
("rptAIEapplicationTotalsByDistrict").
In the SQL statement for the report is a statement that refers to the year
selected on the form ("frmAIEgeneralReports") which limits the data shown on
the report.
Once the report has been opened, the form should close.
There are DSum statements in the footer of the report that work only if the
form is still open or is closed manually. These DSum statements also refer
to the year selected on the form.
If the following code is used to open the report and then close the form,
the DSum statements in the footer of the report show errors.
Private Sub cmdPrevRptAppnTotalsByDistrict_Click()
Dim stDocName As String
stDocName = "rptAIEapplicationTotalsByDistrict"
DoCmd.OpenReport stDocName, acPreview
stDocName = "frmAIEgeneralreports"
DoCmd.Close acForm, stDocName
End Sub
By simply eliminating the "DoCmd.Clse acForm..." line, the report opens
without errors. Even after I close the form manually, the report still reads
perfectly. Why can I not automote the closing of the form without generating
errors on the report?
Thanks in advance for any advice.
_Kevin
("rptAIEapplicationTotalsByDistrict").
In the SQL statement for the report is a statement that refers to the year
selected on the form ("frmAIEgeneralReports") which limits the data shown on
the report.
Once the report has been opened, the form should close.
There are DSum statements in the footer of the report that work only if the
form is still open or is closed manually. These DSum statements also refer
to the year selected on the form.
If the following code is used to open the report and then close the form,
the DSum statements in the footer of the report show errors.
Private Sub cmdPrevRptAppnTotalsByDistrict_Click()
Dim stDocName As String
stDocName = "rptAIEapplicationTotalsByDistrict"
DoCmd.OpenReport stDocName, acPreview
stDocName = "frmAIEgeneralreports"
DoCmd.Close acForm, stDocName
End Sub
By simply eliminating the "DoCmd.Clse acForm..." line, the report opens
without errors. Even after I close the form manually, the report still reads
perfectly. Why can I not automote the closing of the form without generating
errors on the report?
Thanks in advance for any advice.
_Kevin