473,320 Members | 1,969 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,320 software developers and data experts.

Modify System Error Messages

I have a Form to which records are added using an Append Query which relies on a parameter entered by the user. In the event that the parameter supplied by user would cause a duplicate entry, the system generates an error message which would not make much sense to the average end user. I wish to customize my own message if this problem occurs. I have made some attempts to replace the system message by setting the Form's OnErrr property as follows:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Error(DataErr As Integer, Response As Integer)
  2.    MsgBox "Error No.:" & DataErr
  3.  
  4. If DataErr = 2950 Then
  5.     MsgBox "Employee ID # you supplied has already been entered.  Please enter your Employee ID #."
  6.  
  7.     Response = acDataErrContinue
  8.  
  9.     Else
  10.         MsgBox "Error No.:" & DataErr
  11. End If
  12.  
  13. End Sub
This however has not solved the problem as I continue to get the system generated error. I wonder if it does not work because the error is as a result of the Query and not necessarily the Form?

Would really appreciate some help.
Thanks much.
Feb 2 '12 #1
3 1789
TheSmileyCoder
2,322 Expert Mod 2GB
First off, are any of the custom message boxes you have shown here displayed? I.e. is the code actually being run?

You mention an append query, but don't show any code runnning said append query. Please supply those details.
Feb 2 '12 #2
Thanks for your response,

No, the message boxes don't display. My queries are not written in VB codes but created in Access. I can however show you the SQL that Access generates for the query below:

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO [Attendance 2] ( [Employee #], Employee, [Employee ID], [Department Name], [Late Exempt] )
  2. SELECT EMPLOYEES.[Employee #], [Fname] & " " & [Lname] AS Employee, EMPLOYEES.[Employee ID], Department.[Department Name], EMPLOYEES.[Late Exempt]
  3. FROM (EMPLOYEES LEFT JOIN Attendance ON EMPLOYEES.[Employee ID] = Attendance.[Employee ID]) LEFT JOIN Department ON EMPLOYEES.[Department ID] = Department.[Department ID]
  4. WHERE (((EMPLOYEES.[Employee #])=[Enter Your Employee # and click OK -  Check that your name appears at the bottom of list]));
Hopes this give you a little more insight into my problem.
Feb 2 '12 #3
NeoPa
32,556 Expert Mod 16PB
This sounds like your code is not breaking on errors. See Debugging in VBA - 3) General Tips for help with this.
Feb 2 '12 #4

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

Similar topics

2
by: Jon Maz | last post by:
Hi All, To allow myself to make development changes directly on a remote server *without* having to compile on my local dev machine and then upload the dll's to remote, I have created a...
1
by: johnpeter887 | last post by:
On windows xp we can modify 500-100.asp file for custom asp error messages. How can we do this on a windows NT 4.0 and IIS. or what is the similar file on NT and IIS?
0
by: R Bolling | last post by:
I have a procedure that appends a flatfile daily into a table. In most cases the procedure works as expected, but periodically, the mainframe generated flatfile is corrupted and it stops the...
102
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler...
1
by: Jacob | last post by:
Hi, How can i store custom error messages, can i store it in a resource file , like ErMsgs.Resx. if i store it in a .resx file, can i modify it without recompiling, if so how can i change it...
0
by: roger23 | last post by:
I get this error C:\Program Files\MSBuild\Microsoft\WebDeployment\v8.0\Microsoft.WebDeployment.targets(526,9): error MSB6006: "aspnet_compiler.exe" exited with code 1. at the end of my build...
4
by: Lambuz | last post by:
When an HTTP 500.100 occure in IIS 5.0, I was getting redirected to a HTTP 500.100 - 'page cannot be displayed' error page when there was an error, but now in IIS 6.0, I get 'Microsoft VBScript...
4
by: mirandacascade | last post by:
O/S : Win2K vsn of Python: 2.4 Hoping to find information that provide information about error messages being encountered. Pythonwin session: Traceback (most recent call last): File...
5
by: JuhaM | last post by:
Hi All Just wondering if its possible get more descriptive error messages in to com.ibm.db2.jcc.b.SqlException. getMessge or toString() methods gives only SQL-error codes like: SQLCODE: -1218,...
1
by: bdockery | last post by:
Here's yet another one Mccarthy and Rabbit :) I'm sure you know this since you know everything! Do you just have to have error-checking code that pops up a msgBox and prevents the error in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.