Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2008
    Location
    All over, Now in Missouri
    Posts
    73

    Unanswered: How to stop report from displaying

    Where there is no data in the report I want to display one message and then exit.

    This code gives a MsgBox and then displays report.

    Private Sub Report_NoData(Cancel As Integer)
    MsgBox "There are no records to report", vbExclamation, "No Records"
    End Sub

    This code gives two (2) MsgBox's

    Private Sub Report_NoData(Cancel As Integer)
    MsgBox "There are no records to report", vbExclamation, "No Records"
    Cancel = True
    End Sub

    I just want to have one MsgBox stating "no records to report" then close

    peter
    We tend to look at Linear paths which can lead us to a path of resistance!

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    its a while since Ive used the nodata event.
    if you are gettign two message boxes I'd suggest ditch your code and just set the cancel flag = true in the nodata event
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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