473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Database stoped responding when a report fails to open?

23
Hi,

I have some reports in my database where i put the following VB code to display a No Data message.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_NoData(Cancel As Integer)
  2.     MsgBox "There is no data to display", _
  3.            vbExclamation, _
  4.            "No Records"
  5.     Cancel = True
  6. End Sub
The code works fine but after getting the Message "There is no data to display" The database stops responding.
Can any one please explain me? why the database stops responding ?
Please give me a solution.

Thanks in advance.
Sep 16 '18 #1

✓ answered by NeoPa

Although I don't see why it would stop responding completely I suspect this is more about how little you've actually explained your problem.

What I do know is that when you use the Cancel = True option from within your Report_NoData() event procedure the code that called the report to open is considered to have failed so the code would typically stop with an error prompt. That's always assuming you've set your VBIDE options sensibly though. See Debugging in VBA.

3 1410
NeoPa
32,556 Expert Mod 16PB
Although I don't see why it would stop responding completely I suspect this is more about how little you've actually explained your problem.

What I do know is that when you use the Cancel = True option from within your Report_NoData() event procedure the code that called the report to open is considered to have failed so the code would typically stop with an error prompt. That's always assuming you've set your VBIDE options sensibly though. See Debugging in VBA.
Sep 16 '18 #2
moonrb
23
Dear Friend

Thank you so much for your reply. Your given link helped me to solve the problem. I set to Break on All Errors in Tools / Options / General of VBA Window whereas it was set to Break on Unhandled Errors by default.

Thank you again
Moonrb
Sep 20 '18 #3
NeoPa
32,556 Expert Mod 16PB
Glad to help where I can MoonRB.

Do be careful with what you've just said you've changed though - Break on All Errors is only appropriate for the development stage where you need to see every error, regardless of how you're handling it in the code.

Break on Unhandled Errors, or even Break in Class Module if you're developing any class modules, is the appropriate setting for when you're running your project normally as a user.

If you set this the wrong way you can get very frustrating errors popping up even when they're handled by the code - ostensibly.
Sep 20 '18 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: LaurenW | last post by:
My company has an A2K app that has been running just fine for a long time. Recently, some users notice that the database window appears when some forms are loaded. Right before we release a...
8
by: lauren quantrell | last post by:
When I open an Access form I can have no recordset specified, then in the form's OnOpen event I can do something like: Me.paramaters = "@SomeColumn = 22)" Me.recordsource = "dbo.sproc123" But I...
28
by: Sathyaish | last post by:
If fopen fails, is there a way to know why?
3
by: Steve Yerkes | last post by:
There seems to be way too much confusion over how to set focus on the a field using a field validator. I looked all over the web and found people trying to do this, but not getting anywhere. There...
1
by: hubristicbob | last post by:
hi, this might be an easy one to answer but I can't find the info on this. I am building an ASP.NET application that displays crystal reports from a network location. I can load any report on...
0
by: Ray | last post by:
Dear all, Now I am using the report document in vb.net to call the crystal report and I will set the database information in the report document. The code is as follow: ......
6
by: Agnes | last post by:
Please help, i had completed over 30-50 reports, now. our client insist to change the database name. anyshorcut that I can change the database name in the report without re-write all of them ??...
7
by: MrDeej | last post by:
Hello I have noticed that access usually "stops responding" when i activiate large SQL operations. This is a problem in the case that i want i. e. a postcounter which tells the user how many post...
2
by: hmznzr | last post by:
i am using b.net 2005. i am generating a crystal report. but when i work in a different computer i have to set the location of the database of the report before i generate. is their any dynamic way...
4
by: comtrendz | last post by:
Application fails with error: 80040154 when attempting to open a doc in Word 2010. I have a VB.Net app that uses word to open documents. I am running VS 2008 on my PC with Office 2003. When I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.