Results 1 to 3 of 3
  1. #1
    annyK is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    2

    MessageBox if the report is Empty

    Hello all,



    after having struggled for 4 days alone I decided to post my problem here. Hopefully someone can help me!

    I have a form with some blank fields for the date period (should be inserted) and an Open Report Button. The report shows some data that were modified in this period.

    If there were no modifications during the entered period the opened report will contain only the header but no values.

    What I need now is to insert a MessageBox "No values in this period", when the report opens and it is empty.

    Therefore I created the following macro:

    if IsError([Reports]![UserAdminLogReport_Japan]![Modification]) Then
    MessageBox "No values in this period"
    End If

    This macro actually works, but only when the report is open and I click on the macro.
    So my question is: What can I do if I want the MessageBox to appear directly after (or insted of) opening of the report without having to click on the macro itself.

    I would be so thankful for any suggestions and help.

    Thanks in advance

    Anna

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    You should be able to display a message box by using the reports On NoData event. You can also cancel the opening of the report in this event.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    annyK is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    2
    Thanks! This helped!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. On Change or Before Update? MessageBox
    By burrina in forum Forms
    Replies: 6
    Last Post: 01-05-2013, 12:09 PM
  2. Replies: 2
    Last Post: 04-23-2012, 10:13 PM
  3. MessageBox Based on Recordset Count
    By Two Gun in forum Forms
    Replies: 3
    Last Post: 12-25-2011, 07:54 AM
  4. messagebox help :D
    By imintrouble in forum Forms
    Replies: 2
    Last Post: 10-20-2011, 01:50 PM
  5. Make a messagebox
    By carstenhdk in forum Queries
    Replies: 7
    Last Post: 05-18-2010, 06:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums