L
Leslie Isaacs
Hello All
I have a form which, when it is opened, I would like a report called "rpt
locum confirmation notice outstanding" to be opened - but only if there is
data for that report. I have set the OnNoData event for the report to:
Cancel=True
.... and I have set the OnOpen event of the form to:
Private Sub Form_Open(Cancel As Integer)
Dim stDocName As String
stDocName = "rpt locum confirmation notice outstanding"
DoCmd.OpenReport stDocName, acPreview
On Error Resume Next
If Err = 2501 Then Err.Clear
On Error Resume Next
End Sub
.... but I find that when there is no data for "rpt locum confirmation notice
outstanding" I still get the error 2501 message.
What have I done wrong?
Hope someone can help
Many thanks
Leslie Isaacs
I have a form which, when it is opened, I would like a report called "rpt
locum confirmation notice outstanding" to be opened - but only if there is
data for that report. I have set the OnNoData event for the report to:
Cancel=True
.... and I have set the OnOpen event of the form to:
Private Sub Form_Open(Cancel As Integer)
Dim stDocName As String
stDocName = "rpt locum confirmation notice outstanding"
DoCmd.OpenReport stDocName, acPreview
On Error Resume Next
If Err = 2501 Then Err.Clear
On Error Resume Next
End Sub
.... but I find that when there is no data for "rpt locum confirmation notice
outstanding" I still get the error 2501 message.
What have I done wrong?
Hope someone can help
Many thanks
Leslie Isaacs