Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2004
    Posts
    1

    Unanswered: only send report if there is data in it...

    Hello,

    I'm trying to automate the delivery of a report by mail to several users. The problem is that the report should only be sent if there's data to display. I just can't find a way to validate the existance of data and triger an action like SendObject. Any ideas?!

    Thanks in advance!

  2. #2
    Join Date
    Oct 2003
    Posts
    81
    Have you looked into using the "Has No Data" event for the report? Just set your code up in there.

  3. #3
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by RFX
    Hello,

    I'm trying to automate the delivery of a report by mail to several users. The problem is that the report should only be sent if there's data to display. I just can't find a way to validate the existance of data and triger an action like SendObject. Any ideas?!

    Thanks in advance!
    Hi and "Welcome to the Forum"
    Go to your Report in DesignView, go to Properties, Click the EventTab, then to the On No Data line, and the CodeWindow and place the code below in that area. When there is NoData in the report you will receive a message stating so.

    have a nice one,
    BUD

    Code:
    Private Sub Report_NoData(Cancel As Integer)
    
        DoCmd.CancelEvent
        MsgBox "There are no tools checked out to report on.", vbOKOnly, "No data to report on."
        Cancel = True
            
        
        
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •