473,386 Members | 1,720 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.

On Error happening all the time

Recently, I've rolled out an app to several users, some of whom don't have access on their computers (using runtimes libs instead). I'm trying to track down what the error is, so I put in an "On Error" statement in a likely place in the form. The code grabs the username from environment and the error code, and sends an e-mail to me with the error number. However, it executes every time, regardless of whether there's an error or not. I basically get e-mails with a value of "0" for the error.

What am I missing?
Aug 26 '08 #1
4 983
Megalog
378 Expert 256MB
Can you post one of your subroutines so we can verify that the error is being trapped correctly?

As far as a fix, you could insert a simple check in your error trap section like:

Expand|Select|Wrap|Line Numbers
  1. PrivateSub_Error:
  2.     If Err.Number <> 0 Then
  3.        <<call your email function>>
  4.     End If
  5.  
  6. End Sub
Aug 26 '08 #2
missinglinq
3,532 Expert 2GB
As Megalog insinuated, it's difficult for us to troubleshoot your code unless we can see it!

Linq ;0)>
Aug 26 '08 #3
Thanks for the replies, but I found the problem. I didn't have "Exit Sub" before my error handling routine, so even if the code was executing successfully, it was getting to the eh routine and running that code afterwards.
Aug 26 '08 #4
missinglinq
3,532 Expert 2GB
In other words, Access was doing exactly what you told it to do! Don't you just hate it when that happens? LOL!

Glad you figured it out, and thanks for posting the solution back to us!

Linq ;0)>
Aug 26 '08 #5

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

Similar topics

7
by: Paul | last post by:
I thought this is more of an IE issue but i've had no joy on that group perhaps somebody here will have a clue. If i click a link to a web page embedded in Excel (97 OR 2000) i get the standard...
4
by: Bhavna | last post by:
Hello Does anyone know what this message could be regarding? The application seems to fall over on the following line. Dim variable1 As SqlString = Arraylist1(i The first time the code runs...
18
by: Steve | last post by:
Hi I have a really weird problem and any assistance would be welcome. I have developed an app in Access 2002. The app runs perfectly on the development machine. I have packaged the app using...
16
by: TD | last post by:
This is the code under a command button - Dim ctl As Control For Each ctl In Me.Controls If ctl.BackColor <> RGB(255, 255, 255) Then ctl.BackColor = RGB(255, 255, 255) End If Next ctl
10
by: Shawn | last post by:
JIT Debugging failed with the following error: Access is denied. JIT Debugging was initiated by the following account 'PLISKEN\ASPNET' I get this messag in a dialog window when I try to open an...
6
by: blash | last post by:
Can someone help me? I really don't have a clue. My company staff told me they often got such error: "Object reference not set to an instance of an object." when they are in search result page...
5
by: Nathan Sokalski | last post by:
When I view my index.aspx page any time after the first time, I recieve the following error: System.Web.TraceContext.AddNewControl(String id, String parentId, String type, Int32 viewStateSize)...
16
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In:...
10
by: Anthony England | last post by:
(sorry for the likely repost, but it is still not showing on my news server and after that much typing, I don't want to lose it) I am considering general error handling routines and have...
2
by: xxsassxx31 | last post by:
Hello....beforehand I want to thank you for your help regarding the problems I can't seem to fix. I am using Windows Vista and I have run scandisk/disk defrag/computer cleanup with various programs...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...

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.