skea
Registered User.
- Local time
- Tomorrow, 00:39
- Joined
- Dec 21, 2004
- Messages
- 342
I have a Report linked with a SubReport. I would like to cancel viewing this Report if my SubReport Has No Data.
i tried this code but the report just shows up. Any Ideas?
Ok i got an error message. Yoy entered an expression that has an invalid Reference to the hasData property.
Ive tried using a text bpx on my main report and putting a control source as
Then in my Report Open Event i put the code below. But it fails me still.
i tried this code but the report just shows up. Any Ideas?
Code:
Private Sub Report_Open(Cancel As Integer)
On Error GoTo Err_Trapper
If Reports![qryRepCurOrgProjsSR].Report.HasData = 0 Then
Cancel = True
End If
Err_Trapper:
MsgBox Err.Description
Exit Sub
End Sub
Ok i got an error message. Yoy entered an expression that has an invalid Reference to the hasData property.
Ive tried using a text bpx on my main report and putting a control source as
Code:
=IIf(qryRepCurOrgProjsSR.Report.HasData,0,"Nothing")
Code:
If trim(Me.MyText) = "Nothing" Then
MsgBox "The Report Is Cancelling....."
Cancel = True
Exit Sub
End If
Last edited: