473,406 Members | 2,336 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,406 software developers and data experts.

Random error Message box

hello,

I have used the advice on this site to clear a specific error when a
report is generated without any data.

Err_cmdLaunchItemsReport_Click:
Select Case Err.Number
Case 2501
Err.Clear
Case Else
MsgBox Err.Number & Err.Description
End Select

However, if the report does have data, I now get a Message Box that has
no heading and only contains a zero, "0". This happens everytime the
report is opened.

What have I done wrong/have I not done?

Really appreciate your help.

Feb 13 '06 #1
3 1749
Above the code you posted, you forgot to add the line:
Exit Sub
or possibly:
Exit Function

As a result, even with the code runs successfully, the error handling part
is executed too.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"badboybrown" <se*****@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
hello,

I have used the advice on this site to clear a specific error when a
report is generated without any data.

Err_cmdLaunchItemsReport_Click:
Select Case Err.Number
Case 2501
Err.Clear
Case Else
MsgBox Err.Number & Err.Description
End Select

However, if the report does have data, I now get a Message Box that has
no heading and only contains a zero, "0". This happens everytime the
report is opened.

What have I done wrong/have I not done?

Really appreciate your help.

Feb 13 '06 #2
"badboybrown" <se*****@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
hello,

I have used the advice on this site to clear a specific error when a
report is generated without any data.

Err_cmdLaunchItemsReport_Click:
Select Case Err.Number
Case 2501
Err.Clear
Case Else
MsgBox Err.Number & Err.Description
End Select

However, if the report does have data, I now get a Message Box that has
no heading and only contains a zero, "0". This happens everytime the
report is opened.

What have I done wrong/have I not done?

Really appreciate your help.

The zero is the contents of Err.Number - there is no error but the code is
running anyway. You need "Exit Sub" before the error handling code.

Keith.
www.keithwilby.com
Feb 13 '06 #3
Thanks.

Very much appreciated.

I'm learning as I go...

Feb 13 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Acacia | last post by:
How would you generate a random number in C++?
8
by: jon morgan | last post by:
OK, I'm going to be brave. There is a bug in VS.Net 1.1 that causes random compiler errors. I have raised this issue in posts at least three time in the past couple of months without attracting...
16
by: Jason | last post by:
Hi, I need a way to use random numbers in c++. In my c++ project, when using the mingw compiler I used a mersenne twister that is publicly available and this did its job well. Now I have...
10
by: Marshall Belew | last post by:
I'm trying to synchronize a network app that uses random numbers generated by System.Random. Rather than pass every randomly generated number, I just pass the seed. I'm seeing a result that leads...
13
by: Roy Gourgi | last post by:
Hi, How do I invoke the random number generator that was suggested by a few people. Ideally, what I would like to do is to instantiate the random no. generator with a seed value that does not...
104
by: fieldfallow | last post by:
Hello all, Is there a function in the standard C library which returns a prime number which is also pseudo-random? Assuming there isn't, as it appears from the docs that I have, is there a...
1
by: ssims | last post by:
I've got this code for a random GDI+ chart generator, and the demo works, but when I try to run it on my local machine I get a compiler error: Compiler Error Message: CS0117: 'Random' does not...
16
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I generate a random integer from 1 to N?...
12
by: Naya | last post by:
Hi. I am working on a math tutoring program which generates two random numbers (from 1 to 500) and asks the user to add them. How can I check to see whether or not they put in the correct total??...
3
by: Army1987 | last post by:
Is there anything wrong with this program? It seems to behave strangely if I give stdin EOF when asked for the character set... /* BEGIN pwdgen.c */ #include <stdio.h> #include "random.h"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.