L
Lizzy
Hi,
I have an intermittent problem running a report with an
embedded graph off a dialog box with a date range.
Sometimes it runs fine and other times on close where it
is closing the Date Range Dialog box it asks for the
dates again. I checked the reports queries and they look
fine. It seems like the sequence of events are getting
confused. I was wondering if there was any code that I
could use to trap for this.
Here is my current code.
Private Sub Report_Close()
'this is where the problem occurs-a parameter value text
'box appears asking to enter-Forms!dlgDateRangeStartDate
'and Forms!dlgDateRangeEndDate
On Error GoTo err_handler
If IsLoaded(acForm, "dlgDateRange") = True Then
DoCmd.Close acForm, "dlgDateRange"
End If
exit_sub:
On Error Resume Next
Exit Sub
err_handler:
MsgBox Err.Number & " : " & Err.Description, vbOKOnly
+ vbCritical, "Error"
Resume exit_sub
End Sub
I have an intermittent problem running a report with an
embedded graph off a dialog box with a date range.
Sometimes it runs fine and other times on close where it
is closing the Date Range Dialog box it asks for the
dates again. I checked the reports queries and they look
fine. It seems like the sequence of events are getting
confused. I was wondering if there was any code that I
could use to trap for this.
Here is my current code.
Private Sub Report_Close()
'this is where the problem occurs-a parameter value text
'box appears asking to enter-Forms!dlgDateRangeStartDate
'and Forms!dlgDateRangeEndDate
On Error GoTo err_handler
If IsLoaded(acForm, "dlgDateRange") = True Then
DoCmd.Close acForm, "dlgDateRange"
End If
exit_sub:
On Error Resume Next
Exit Sub
err_handler:
MsgBox Err.Number & " : " & Err.Description, vbOKOnly
+ vbCritical, "Error"
Resume exit_sub
End Sub