Advertisement

05.13.2008 at 11:34AM PDT, ID: 23398917
[x]
Attachment Details

Database crashes when opening report with 'on no data' event

Asked by S_Hamel in Access Coding/Macros

Tags: Microsoft Access, VBA

Hi,

This is my first question so hopefully I provide everyone with enough info. I have a database developed in Access 2000. It works fine when the users have Access 2000 or 2003 on their computer. But the couple of users that have 2007, when the 'on no data' event is executed, Access closes. Here is the code:

Private Sub Report_NoData(Cancel As Integer)
    MsgBox "There are no transactions for this date.", vbInformation, "No Transactions"
    Cancel = True
End Sub

It seems that it does not like the line 'Cancel = True', because when I take it out, I still get the message.

I get the messages "Access has stopped working" and then "Access is restarting". Is there a reference I need to add in 2007 in order for it to work?

 Any help is greatly appreciated.

Thanks.Start Free Trial
 
Loading Advertisement...
 
[+][-]05.13.2008 at 11:56AM PDT, ID: 21558136

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Access Coding/Macros
Tags: Microsoft Access, VBA
Sign Up Now!
Solution Provided By: jimhorn
Participating Experts: 2
Solution Grade: B
 
 
[+][-]05.13.2008 at 02:45PM PDT, ID: 21559579

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 02:36AM PDT, ID: 21562382

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 10:12AM PDT, ID: 21566404

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 11:39AM PDT, ID: 21626403

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628