Hello,
for the first time I am working with an BE SQL server and now I have the following problem.
I want to cancel the command cmd.openreport when there is no data.
Normaly i use on the report --> cancel = true
And behind the button the following code:
Private Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_click
Dim stDocName As String
stDocName = "Rpt_Moederrollenoverzicht"
DoCmd.OpenReport stDocName, acViewPreview
Exit_cmdPrint_click:
Exit Sub
Err_cmdPrint_click:
If Err.Number = 2501 Then
Resume Next
Else
MsgBox Err.Description
Resume Exit_cmdPrint_click
End If
End Sub
This is not working anymore and I don't know why?
Who can help me?
Thanks in advance,
Sven.
for the first time I am working with an BE SQL server and now I have the following problem.
I want to cancel the command cmd.openreport when there is no data.
Normaly i use on the report --> cancel = true
And behind the button the following code:
Private Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_click
Dim stDocName As String
stDocName = "Rpt_Moederrollenoverzicht"
DoCmd.OpenReport stDocName, acViewPreview
Exit_cmdPrint_click:
Exit Sub
Err_cmdPrint_click:
If Err.Number = 2501 Then
Resume Next
Else
MsgBox Err.Description
Resume Exit_cmdPrint_click
End If
End Sub
This is not working anymore and I don't know why?
Who can help me?
Thanks in advance,
Sven.