Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

Report is activating On No Data event when report has data

I have a report that I call with up various filters.... with one particular filter the report has data but for some reason it is triggering the On No Data event.

Why is this occuring?
0
thandel
Asked:
thandel
  • 4
  • 3
1 Solution
 
harfangCommented:
We can't answer that with the information provided. Perhaps you have data in a sub-report but not in the main report, perhaps there is something wrong with the filter and you only think it should contain data. What does your "on no data" event hander perform, and how do you know there is data in the report?

(°v°)
0
 
thandelAuthor Commented:
There are not any subreports on the report, nothing wrong with the filter, as I look at the report it is pulling up the correct data on the report (which is why I"m puzzled why the event is being triggered)... the "on no data event" is only posting a message that there isn't any data to display.

Is there anything else I can provide for a solution?

Thank you.
0
 
harfangCommented:
It's going to be difficult to find, although it might be something very simple. If the module behind the report isn't too long, please post it here. And show also the record source of the report as well as the line opening it, in case you add a filter there.

(°v°)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
thandelAuthor Commented:
Report record source: tMain

Here is the code for the report:

Option Compare Database
Private m_RowCount As Long

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'white 16777215
'light green 12713921
m_RowCount = m_RowCount + 1
    If m_RowCount / 2 = CLng(m_RowCount / 2) Then
            Me.Detail.BackColor = 16777215
        Else
            Me.Detail.BackColor = 12713921
    End If
End Sub

Private Sub Report_NoData(Cancel As Integer)
   
    MsgBox "No orders to process with given criteria.", vbInformation, "Report"
    Cancel = True
   
End Sub


Line opening the report:

If Me.ReportSel = 2 And Me.LocSelect = "ALL" And Me.StatusSelect = "Active" Then DoCmd.OpenReport "rGeneralShort", acViewPreview, , "(((tMain.Status)=""In Progress"" Or (tMain.Status)=""Submitted"" Or (tMain.Status) Like ""*Pending*""))"


It should be noted that if I use the following command without a filter I still get the same error.  
If Me.ReportSel = 2 And Me.LocSelect = "ALL" And Me.StatusSelect = "Active" Then DoCmd.OpenReport "rGeneralShort", acViewPreview

It should also be noted that I manually open the report with out a filter set then  I don't recieve any error message.

0
 
thandelAuthor Commented:
OK nevermind I found it... I had several conditional statements and one was calling a report after it was previously called.  Thanks for your help.
0
 
harfangCommented:
I'm glad you did! -- (°v°)
0
 
thandelAuthor Commented:
I feel silly but thanks again.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now